Public Member Functions | |
Decoder (const std::string &xmlTemplates, const OnixS::FIX::Dictionary &fixDictionary, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits) | |
Decoder (const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits) | |
Decoder (ProtocolVersion::Enum baseVersionForGeneratedDictionary, const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits) | |
Decoder (ProtocolVersion::Enum baseVersionForGeneratedDictionary, const std::string &xmlTemplates, const std::string &genericFixDictionaryId, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits) | |
~Decoder () | |
InputDataTraits::Enum | inputDataTraits () const |
const OnixS::FIX::Message & | decode (const char *buffer, size_t bufferSize) |
const OnixS::FIX::Message & | decode (const unsigned char *buffer, size_t bufferSize) |
const OnixS::FIX::Message & | decode (const std::vector< char > &chunk) |
const OnixS::FIX::Message & | decode (const OnixS::Sockets::Bytes &chunk) |
bool | tryDecode (const char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes) |
bool | tryDecode (const unsigned char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes) |
void | reset () |
OnixS::FIX::Dictionary | fixDictionary () const |
void | maximumNumberOfRepeatingGroupEntries (int value) |
int | maximumNumberOfRepeatingGroupEntries () const |
Static Public Member Functions | |
static bool | tryDecodeUnsignedInteger (const char *buffer, size_t bufferSize, unsigned int *value, size_t *fieldLength) |
static bool | tryDecodeUnsignedInteger (const unsigned char *buffer, size_t bufferSize, unsigned int *value, size_t *fieldLength) |
static void | generateFixDictionary (const std::string &fastTemplateXml, const std::string &fixDictionaryId, std::string *fixDictionaryXml) |
static void | generateFixDictionary (ProtocolVersion::Enum baseVersion, const std::string &fastTemplateXml, const std::string &fixDictionaryId, std::string *fixDictionaryXml) |
Decoder | ( | const std::string & | xmlTemplates, |
const OnixS::FIX::Dictionary & | fixDictionary, | ||
bool | decodeEachMessageIndependently, | ||
InputDataTraits::Enum | inputDataTraits ) |
Creates a FAST to FIX Decoder.
xmlTemplates | XML-based FAST templates. |
fixDictionary | The customized FIX dictionary used for the decoded message. |
decodeEachMessageIndependently | The option to reset the previous values dictionaries before decoding a new FAST stream chunk. |
inputDataTraits | Traits of input data, has effect only when decodeEachMessageIndependently is false . See InputDataTraits::Enum for details. |
Decoder | ( | const std::string & | xmlTemplates, |
bool | decodeEachMessageIndependently, | ||
InputDataTraits::Enum | inputDataTraits ) |
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, it uses the FIX 4.0 as a base FIX dictionary and has a generic name.
xmlTemplates | XML-based FAST templates. |
decodeEachMessageIndependently | The option to reset the previous values dictionaries before decoding a new FAST stream chunk. |
inputDataTraits | Traits of input data, has effect only when decodeEachMessageIndependently is false . See InputDataTraits::Enum for details. |
Decoder | ( | ProtocolVersion::Enum | baseVersionForGeneratedDictionary, |
const std::string & | xmlTemplates, | ||
bool | decodeEachMessageIndependently, | ||
InputDataTraits::Enum | inputDataTraits ) |
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, it uses the specified FIX dictionary as a base and has a generic name.
baseVersionForGeneratedDictionary | This version of the FIX protocol becomes the base for the newly generated FIX dictionary. |
xmlTemplates | XML-based FAST templates used to generate the FIX dictionary. This FIX dictionary takes a generic identifier generated on a base of the XML content and baseVersion |
decodeEachMessageIndependently | The option to reset the previous values dictionaries before decoding a new FAST stream chunk. |
inputDataTraits | Traits of input data, has effect only when decodeEachMessageIndependently is false . See InputDataTraits::Enum for details. |
Decoder | ( | ProtocolVersion::Enum | baseVersionForGeneratedDictionary, |
const std::string & | xmlTemplates, | ||
const std::string & | genericFixDictionaryId, | ||
bool | decodeEachMessageIndependently, | ||
InputDataTraits::Enum | inputDataTraits ) |
Creates a FAST to FIX Decoder for the FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, it uses the specified FIX dictionary as a base and has the specified name.
baseVersionForGeneratedDictionary | This version of the FIX protocol becomes the base for the newly generated FIX dictionary. |
xmlTemplates | XML-based FAST templates. |
genericFixDictionaryId | The identifier which is applied to the generic FIX dictionary. This FIX dictionary is generated using xmlTemplates and baseVersion . |
decodeEachMessageIndependently | The option to reset the previous values dictionaries before decoding a new FAST stream chunk. |
inputDataTraits | Traits of input data, has effect only when decodeEachMessageIndependently is false . See InputDataTraits::Enum for details. |
~Decoder | ( | ) |
The destructor.
const OnixS::FIX::Message & decode | ( | const char * | buffer, |
size_t | bufferSize ) |
Decodes the given FAST stream chunk into the corresponding FIX Message.
buffer | The buffer that contains the FAST stream chunk to be decoded. |
bufferSize | The size of the buffer. |
An | exception if the message cannot be decoded. |
const OnixS::FIX::Message & decode | ( | const OnixS::Sockets::Bytes & | chunk | ) |
const OnixS::FIX::Message & decode | ( | const std::vector< char > & | chunk | ) |
Decodes the given FAST stream chunk into the corresponding FIX Message.
chunk | The FAST stream chunk to be decoded. |
An | exception if the message cannot be decoded. |
const OnixS::FIX::Message & decode | ( | const unsigned char * | buffer, |
size_t | bufferSize ) |
OnixS::FIX::Dictionary fixDictionary | ( | ) | const |
|
static |
|
static |
Generates the FIX dictionary XML.
[in] | fastTemplateXml | The XML content of the FAST template (the same as used to initialize the Decoder). |
[in] | baseVersion | This version of the FIX protocol becomes the base for the newly generated FIX dictionary. |
[in] | fixDictionaryId | The output FIX dictionary identifier (see "id" attribute of "FIX" node). |
[out] | fixDictionaryXml | The XML with the generated FIX dictionary. |
InputDataTraits::Enum inputDataTraits | ( | ) | const |
Input data traits of the decoder.
int maximumNumberOfRepeatingGroupEntries | ( | ) | const |
The maximum number of repeating groups, allowed for decoded messages.
int
type. void maximumNumberOfRepeatingGroupEntries | ( | int | value | ) |
Manages the maximum number of repeating groups, allowed for decoded messages.
This parameter is used during the decoding and is useful to detect a broken data, which, in particular cases, can 'need' to allocate an unexpectedly huge number of entries (for instance - billions of entries, while normally there are just a few ones). This situation results in memory exhausting and (often) significantly decreases the overall system performance.
To prevent the memory exhausting and negative consequences of that, this parameter should be configured with the value, which is greater then the maximum possible number of entries in valid input data, but less then the maximum integer value (default one). In a lot of real cases the value of 10000 is good enough to detect broken data without the memory overloading.
Default is the maximum positive value for int
type.
value | The number of repeating groups, allowed for decoded messages. |
void reset | ( | ) |
Resets the state of the previous values dictionaries (sets the state of the previous values to undefined).
bool tryDecode | ( | const char * | buffer, |
size_t | offset, | ||
size_t | count, | ||
OnixS::FIX::Message * | message, | ||
size_t * | numberOfDecodedBytes ) |
Tries to decode the given FAST stream buffer into the corresponding FIX Message.
[in] | buffer | The FAST stream chunk to be decoded. |
[in] | offset | The index in the buffer at which decoding begins. |
[in] | count | The number of bytes to analyze during the decoding. |
[out] | message | The pointer to the decoded FIX Message. |
[out] | numberOfDecodedBytes | The number of bytes that contained the encoded FIX Message. |
An | exception if the decoding error is detected. |
bool tryDecode | ( | const unsigned char * | buffer, |
size_t | offset, | ||
size_t | count, | ||
OnixS::FIX::Message * | message, | ||
size_t * | numberOfDecodedBytes ) |
|
static |
Decodes the FAST-encoded unsigned integer.
buffer | The buffer that contains the FAST stream chunk to be decoded. |
bufferSize | The size of the buffer. |
value | The decoded value. |
fieldLength | The number of bytes that contained the encoded value. |
|
static |