Gemstone PhasorProtocols Library
Show/Hide TOC

# FrameParserParseCommonHeader Method

Parses a common header instance that implements ICommonHeader for the output type represented in the binary image.

## Definition

Namespace: Gemstone.PhasorProtocols.SelCWS
Assembly: Gemstone.PhasorProtocols (in Gemstone.PhasorProtocols.dll) Version: 1.0.164 -- Release Build+e526f121ce33f6a601f5d1519047de17ef46ec99
C#
View Source Request Example

    protected override ICommonHeader<FrameType>? ParseCommonHeader(
    	byte[] buffer,
    	int offset,
    	int length
    )

VB
View Source Request Example

    Protected Overrides Function ParseCommonHeader (
    	buffer As Byte(),
    	offset As Integer,
    	length As Integer
    ) As ICommonHeader(Of FrameType)

C++
View Source Request Example

    protected:
    virtual ICommonHeader<FrameType>^ ParseCommonHeader(
    	array<unsigned char>^ buffer,
    	int offset,
    	int length
    ) override

JavaScript
View Source Request Example

    function ParseCommonHeader(buffer, offset, length);

#### Parameters

buffer Byte
  Buffer containing data to parse.
offset Int32
  Offset index into buffer that represents where to start parsing.
length Int32
  Maximum length of valid data from offset.

#### Return Value

ICommonHeader FrameType
The ICommonHeader which includes a type ID for the Type to be parsed.

## Remarks

Derived classes need to provide a common header instance (i.e., class that implements ICommonHeader) for the output types; this will primarily include an ID of the Type that the data image represents. This parsing is only for common header information, actual parsing will be handled by output type via its ParseBinaryImage(Byte[], Int32, Int32) method. This header image should also be used to add needed complex state information about the output type being parsed if needed.

If there is not enough buffer available to parse common header (as determined by length), return null. Also, if the protocol allows frame length to be determined at the time common header is being parsed and there is not enough buffer to parse the entire frame, it will be optimal to prevent further parsing by returning null.

## See Also

#### Reference

FrameParser Class
Gemstone.PhasorProtocols.SelCWS Namespace