Both OnixS::FIX::FAST::Encoder and OnixS::FIX::FAST::Decoder constructors require the string, that contains the XML-based descriptions of coding rules, called FAST templates
.
A FAST template represents an XML-based description of encoding and decoding rules in accordance with the FAST specification.
A template identifier (Template ID) is assigned for each FAST template, which uniquely identifies the encoding/decoding rules.
The following example represents a typical FAST template structure:
Following field types are supported:
The required name
attribute identifies the corresponding field in the current FIX message type by the field name.
The optional id
attribute identifies the corresponding field in the current FIX message type by the tag number.
The optional presence
attribute indicates whether the field is mandatory or optional. If the attribute is not specified, the field is mandatory.
A field, that is not of Sequence
type, can have a field operator. The Field Operator specifies an optimization operation for the field.
The following field operators are supported:
Field Operator | Example | Notes |
Constant |
<string name="MessageType" id="35"> |
Specifies that the value of a field will always be the same initial value. Is applicable to all field types. |
Default |
<string name="PosDupFlag" id="43" presence="optional"> |
Specifies that the value of a field is either present in the FAST stream, or it will be the initial value. Is applicable to all field types. |
Copy |
<uInt32 name="MDUpdateAction" id="279"> |
If the value is present in the stream, it becomes the new previous value, otherwise, the value of the field is the previous value. It is applicable to all field types. |
Increment |
<uInt32 name="RptSeq" id="83"> |
If the value is present in the stream, it becomes the new previous value, otherwise, the value of the field is the previous value incremented by one. It is applicable to Integer field types only. |
Delta |
<int32 name="MDEntrySize" id="271"> |
Specifies that a delta value is present in the stream. The field is obtained by combining the delta value with the previous value. Is applicable to Integer, Decimal, String and Byte Vector field types. |
Tail |
<string name="SendingTime" id="52"> |
Specifies, that a tail value is present in the stream. The value of the field is obtained by combining the tail value with the previous value. Is applicable to String and Byte Vector fields with constant or increasing value length. |
Field operators may rely on a previous value. The previous values are maintained in named dictionaries. To reset the states of dictionaries (set the state of the previous values to undefined), the OnixS::FIX::FAST::Encoder::reset and OnixS::FIX::FAST::Decoder::reset methods are used.