/// <summary> /// Creates a new <see cref="ChannelFrameParsingStateBase{T}"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IChannelFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IChannelCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> protected ChannelFrameParsingStateBase(int parsedBinaryLength, CreateNewCellFunction <T> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) { base.ParsedBinaryLength = parsedBinaryLength; CreateNewCell = createNewCellFunction; m_trustHeaderLength = trustHeaderLength; m_validateCheckSum = validateCheckSum; }
/// <summary> /// Creates a new <see cref="DataFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IDataFrame"/> being parsed.</param> /// <param name="configurationFrame">Reference to the <see cref="IConfigurationFrame"/> associated with the <see cref="IDataFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IDataCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public DataFrameParsingState(int parsedBinaryLength, IConfigurationFrame configurationFrame, CreateNewCellFunction <IDataCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, configurationFrame, createNewCellFunction, trustHeaderLength, validateCheckSum) { }
// Fields #endregion #region [ Constructors ] /// <summary> /// Creates a new <see cref="DataFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IDataFrame"/> being parsed.</param> /// <param name="configurationFrame">Reference to the <see cref="IConfigurationFrame"/> associated with the <see cref="IDataFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IDataCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public DataFrameParsingState(int parsedBinaryLength, IConfigurationFrame configurationFrame, CreateNewCellFunction <IDataCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, createNewCellFunction, trustHeaderLength, validateCheckSum) { if (configurationFrame is null) { return; } CellCount = configurationFrame.Cells.Count; ConfigurationFrame = configurationFrame; }
/// <summary> /// Creates a new <see cref="ConfigurationFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="ConfigurationFrame"/> being parsed.</param> /// <param name="configurationFileName">The required external BPA PDCstream INI based configuration file.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="ConfigurationCell"/> instances.</param> public ConfigurationFrameParsingState(int parsedBinaryLength, string configurationFileName, CreateNewCellFunction<IConfigurationCell> createNewCellFunction) : base(parsedBinaryLength, createNewCellFunction) { m_configurationFileName = configurationFileName; }
/// <summary> /// Creates a new <see cref="ConfigurationFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="ConfigurationFrame"/> being parsed.</param> /// <param name="configurationFileName">The required external BPA PDCstream INI based configuration file.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="ConfigurationCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public ConfigurationFrameParsingState(int parsedBinaryLength, string configurationFileName, CreateNewCellFunction<IConfigurationCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, createNewCellFunction, trustHeaderLength, validateCheckSum) { m_configurationFileName = configurationFileName; }
/// <summary> /// Creates a new <see cref="ConfigurationFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="ConfigurationFrame"/> being parsed.</param> /// <param name="configurationFileName">The required external BPA PDCstream INI based configuration file.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="ConfigurationCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public ConfigurationFrameParsingState(int parsedBinaryLength, string configurationFileName, CreateNewCellFunction <IConfigurationCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, createNewCellFunction, trustHeaderLength, validateCheckSum) { m_configurationFileName = configurationFileName; }
/// <summary> /// Creates a new <see cref="ConfigurationFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IConfigurationFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IConfigurationCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> /// <param name="cellCount">Number of cells that exist in the frame to be parsed.</param> public ConfigurationFrameParsingState(int parsedBinaryLength, CreateNewCellFunction <IConfigurationCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum, int cellCount) : base(parsedBinaryLength, createNewCellFunction, trustHeaderLength, validateCheckSum) { CellCount = cellCount; }
/// <summary> /// Creates a new <see cref="DataFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IDataFrame"/> being parsed.</param> /// <param name="configurationFrame">Reference to the <see cref="IConfigurationFrame"/> associated with the <see cref="IDataFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IDataCell"/> instances.</param> public DataFrameParsingState(int parsedBinaryLength, IConfigurationFrame configurationFrame, CreateNewCellFunction<IDataCell> createNewCellFunction) : base(parsedBinaryLength, configurationFrame, createNewCellFunction) { }
/// <summary> /// Creates a new <see cref="DataFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="IDataFrame"/> being parsed.</param> /// <param name="configurationFrame">Reference to the <see cref="IConfigurationFrame"/> associated with the <see cref="IDataFrame"/> being parsed.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="IDataCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public DataFrameParsingState(int parsedBinaryLength, IConfigurationFrame configurationFrame, CreateNewCellFunction<IDataCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, configurationFrame, createNewCellFunction, trustHeaderLength, validateCheckSum) { }
// Fields #endregion #region [ Constructors ] /// <summary> /// Creates a new <see cref="ConfigurationFrameParsingState"/> from specified parameters. /// </summary> /// <param name="parsedBinaryLength">Binary length of the <see cref="ConfigurationFrame"/> being parsed.</param> /// <param name="headerFrame">Previously parsed header frame that contains needed station name.</param> /// <param name="createNewCellFunction">Reference to delegate to create new <see cref="ConfigurationCell"/> instances.</param> /// <param name="trustHeaderLength">Determines if header lengths should be trusted over parsed byte count.</param> /// <param name="validateCheckSum">Determines if frame's check-sum should be validated.</param> public ConfigurationFrameParsingState(int parsedBinaryLength, HeaderFrame headerFrame, CreateNewCellFunction <IConfigurationCell> createNewCellFunction, bool trustHeaderLength, bool validateCheckSum) : base(parsedBinaryLength, createNewCellFunction, trustHeaderLength, validateCheckSum, 1) { HeaderFrame = headerFrame; }