C# Class GSF.TimeSeries.Transport.CompactMeasurement

Represents a IMeasurement that can be serialized with minimal size.
This measurement implementation is serialized through ISupportBinaryImage to allow complete control of binary format. Only critical measurements properties are serialized and every attempt is made to optimize the binary image for purposes of size reduction.
Inheritance: Measurement, IBinaryMeasurement
显示文件 Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
CompactMeasurement ( IMeasurement measurement, SignalIndexCache signalIndexCache, bool includeTime = true, long baseTimeOffsets = null, int timeIndex, bool useMillisecondResolution = false ) : System

Creates a new CompactMeasurement from an existing IMeasurement value.

CompactMeasurement ( SignalIndexCache signalIndexCache, bool includeTime = true, long baseTimeOffsets = null, int timeIndex, bool useMillisecondResolution = false ) : System

Creates a new CompactMeasurement.

GenerateBinaryImage ( byte buffer, int startIndex ) : int

Generates binary image of the CompactMeasurement and copies it into the given buffer, for ISupportBinaryImage.BinaryLength bytes.

Field: Bytes:
-------- -------
Flags 1
ID 2
Value 4
[Time] 2?

Constant Length = 7
Variable Length = 0, 2, 4 or 8 (i.e., total size is 7, 9, 11 or 15)

ParseBinaryImage ( byte buffer, int startIndex, int length ) : int

Initializes CompactMeasurement from the specified binary image.

Method Details

CompactMeasurement() public method

Creates a new CompactMeasurement from an existing IMeasurement value.
public CompactMeasurement ( IMeasurement measurement, SignalIndexCache signalIndexCache, bool includeTime = true, long baseTimeOffsets = null, int timeIndex, bool useMillisecondResolution = false ) : System
measurement IMeasurement Source value.
signalIndexCache SignalIndexCache Signal index cache used to serialize or deserialize runtime information.
includeTime bool Set to true to include time in serialized packet; otherwise false.
baseTimeOffsets long Base time offset array - set to null to use full fidelity measurement time.
timeIndex int Time index to use for base offset.
useMillisecondResolution bool Flag that determines if millisecond resolution is in use for this serialization.
return System

CompactMeasurement() public method

Creates a new CompactMeasurement.
public CompactMeasurement ( SignalIndexCache signalIndexCache, bool includeTime = true, long baseTimeOffsets = null, int timeIndex, bool useMillisecondResolution = false ) : System
signalIndexCache SignalIndexCache Signal index cache used to serialize or deserialize runtime information.
includeTime bool Set to true to include time in serialized packet; otherwise false.
baseTimeOffsets long Base time offset array - set to null to use full fidelity measurement time.
timeIndex int Time index to use for base offset.
useMillisecondResolution bool Flag that determines if millisecond resolution is in use for this serialization.
return System

GenerateBinaryImage() public method

Generates binary image of the CompactMeasurement and copies it into the given buffer, for ISupportBinaryImage.BinaryLength bytes.

Field: Bytes:
-------- -------
Flags 1
ID 2
Value 4
[Time] 2?

Constant Length = 7
Variable Length = 0, 2, 4 or 8 (i.e., total size is 7, 9, 11 or 15)

is null. /// or is less than 0 -or- /// and will exceed length. ///
public GenerateBinaryImage ( byte buffer, int startIndex ) : int
buffer byte Buffer used to hold generated binary image of the source object.
startIndex int 0-based starting index in the to start writing.
return int

ParseBinaryImage() public method

Initializes CompactMeasurement from the specified binary image.
Not enough buffer available to deserialize measurement. is null. /// or is less than 0 -or- /// and will exceed length. ///
public ParseBinaryImage ( byte buffer, int startIndex, int length ) : int
buffer byte Buffer containing binary image to parse.
startIndex int 0-based starting index in the to start parsing.
length int Valid number of bytes within from .
return int