Class MessageWriter
Represents an operator that writes each Harp message in the sequence to a raw binary file.
public class MessageWriter : FileSink<HarpMessage, BinaryWriter>
- Inheritance
-
MessageWriter
- Inherited Members
Properties
FilterType
Gets or sets a value specifying how the message filter will use the matching criteria.
public FilterType FilterType { get; set; }
Property Value
MessageType
Gets or sets a value specifying the expected message type. If no value is specified, all messages will be accepted.
public MessageType? MessageType { get; set; }
Property Value
Methods
CreateWriter(string, HarpMessage)
Creates a binary writer over the specified file that will be responsible for handling the input elements.
protected override BinaryWriter CreateWriter(string fileName, HarpMessage input)
Parameters
fileName
stringThe name of the file on which the elements should be written.
input
HarpMessageThe first input element that needs to be pushed into the file.
Returns
- BinaryWriter
The writer that will be used to push elements into the file.
Process(IObservable<IGroupedObservable<int, HarpMessage>>)
Writes each Harp message in the sequence of observable groups to the corresponding binary file, where the name of each file is generated from the common group register address.
public IObservable<IGroupedObservable<int, HarpMessage>> Process(IObservable<IGroupedObservable<int, HarpMessage>> source)
Parameters
source
IObservable<IGroupedObservable<int, HarpMessage>>A sequence of observable groups, each of which corresponds to a unique register address.
Returns
- IObservable<IGroupedObservable<int, HarpMessage>>
An observable sequence that is identical to the
source
sequence but where there is an additional side effect of writing the Harp messages in each group to the corresponding file.
Process(IObservable<IGroupedObservable<Type, HarpMessage>>)
Writes each Harp message in the sequence of observable groups to the corresponding binary file, where the name of each file is generated from the common group register name.
public IObservable<IGroupedObservable<Type, HarpMessage>> Process(IObservable<IGroupedObservable<Type, HarpMessage>> source)
Parameters
source
IObservable<IGroupedObservable<Type, HarpMessage>>A sequence of observable groups, each of which corresponds to a unique register type.
Returns
- IObservable<IGroupedObservable<Type, HarpMessage>>
An observable sequence that is identical to the
source
sequence but where there is an additional side effect of writing the Harp messages in each group to the corresponding file.
Write(BinaryWriter, HarpMessage)
Writes a new Harp message to the raw binary output stream.
protected override void Write(BinaryWriter writer, HarpMessage input)
Parameters
writer
BinaryWriterA BinaryWriter object used to write binary message data to the output stream.
input
HarpMessageThe Harp message containing the binary data to write into the output stream.