#include <OnixS/FIXEngine/FIX/FAST.h>
|
| 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 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) |
|
Definition at line 137 of file FAST.h.
Creates a FAST to FIX Decoder.
- Parameters
-
xmlTemplates | XML-based FAST templates. |
fixDictionary | Customized FIX dictionary used for decoded message. |
decodeEachMessageIndependently | 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. |
Creates a FAST to FIX Decoder for FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, uses FIX 4.0 as base FIX dictionary and has generic name.
- Parameters
-
xmlTemplates | XML-based FAST templates. |
decodeEachMessageIndependently | 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. |
Creates a FAST to FIX Decoder for FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, uses specified FIX dictionary as base and has generic name.
- Parameters
-
baseVersionForGeneratedDictionary | Version of FIX protocol which dictionary becomes base for the newly generated FIX dictionary. |
xmlTemplates | XML-based FAST templates used to generate FIX dictionary. This FIX dictionary takes generic identifier generated on base of the XML contanet and baseVersion |
decodeEachMessageIndependently | 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. |
Creates a FAST to FIX Decoder for FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided FAST-template content, uses specified FIX dictionary as base and has the specified name.
- Note
- New FIX dictionary instance will be generated if and only if there is no FIX dictionary with the same name.
- Parameters
-
baseVersionForGeneratedDictionary | Version of FIX protocol which dictionary becomes base for the newly generated FIX dictionary. |
xmlTemplates | XML-based FAST templates. |
genericFixDictionaryId | Identifier which is applied to generic FIX dictionary. This FIX dictionary is generated using xmlTemplates and baseVersion . |
decodeEachMessageIndependently | 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. |
Decodes the given FAST stream chunk into the corresponding FIX Message.
- Parameters
-
buffer | Buffer that contains the FAST stream chunk to be decoded. |
bufferSize | Size of the buffer. |
- Warning
- The returned message is 'owned' by Decoder.
-
The previously decoded message is freed by Decoder when this method is called again.
- Exceptions
-
Exception | if the message cannot be decoded. |
- Returns
- the decoded FIX message.
Decodes the given FAST stream chunk into the corresponding FIX Message.
- Parameters
-
chunk | The FAST stream chunk to be decoded. |
- Warning
- The returned message is 'owned' by Decoder.
-
The previously decoded message is freed by Decoder when this method is called again.
- Exceptions
-
Exception | if the message cannot be decoded. |
- Returns
- the decoded FIX message.
FIX dictionary used by the decoder instance.
- Returns
- FIX dictionary currently used by the decoder instance. If the decoder was initialized with FIX dictionary-independent mode, the method returns reference to internally generated FIX dictionary.
static void generateFixDictionary |
( |
const std::string & |
fastTemplateXml, |
|
|
const std::string & |
fixDictionaryId, |
|
|
std::string * |
fixDictionaryXml |
|
) |
| |
|
static |
Generates FIX dictionary XML.
- Parameters
-
[in] | fastTemplateXml | XML content of FAST template (the same as used to initialize Decoder). |
[in] | fixDictionaryId | Output FIX dictionary identifier (see "id" attribute of "FIX" node). |
[out] | fixDictionaryXml | XML with generated FIX dictionary. |
static void generateFixDictionary |
( |
ProtocolVersion::Enum |
baseVersion, |
|
|
const std::string & |
fastTemplateXml, |
|
|
const std::string & |
fixDictionaryId, |
|
|
std::string * |
fixDictionaryXml |
|
) |
| |
|
static |
Generates FIX dictionary XML.
- Parameters
-
[in] | fastTemplateXml | XML content of FAST template (the same as used to initialize Decoder). |
[in] | baseVersion | Version of FIX protocol which dictionary becomes base for the newly generated FIX dictionary. |
[in] | fixDictionaryId | Output FIX dictionary identifier (see "id" attribute of "FIX" node). |
[out] | fixDictionaryXml | XML with generated FIX dictionary. |
Input data traits of the decoder.
- Returns
- Input data traits provided during construction of the decoder.
void maximumNumberOfRepeatingGroupEntries |
( |
int |
value | ) |
|
Manage maximum number of repeating groups, allowed for decoded messages.
This parameter is used during decoding and is useful to detect a broken data, which, in particular cases, can 'need' to allocate 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 decrease overall system performance.
To prevent memory exhausting and negative consequences of that, this parameter should be configured with the value, which is greater then maximum possible number of entries in valid input data, but less then maximum integer value (default one). In a lot of real cases value of 10000 is good enough to detect broken data without memory overloading.
Default is maximum positive value for int
type.
- Parameters
-
value | Number of repeating groups, allowed for decoded messages. |
int maximumNumberOfRepeatingGroupEntries |
( |
| ) |
const |
Maximum number of repeating groups, allowed for decoded messages.
- Returns
- Current number of repeating groups, allowed for decoded messages. Default value is maximum positive value for
int
type.
Resets the state of the previous values dictionaries (sets the state of the previous values to undefined).
- See also
- decodeEachMessageIndependently.
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.
- Parameters
-
[in] | buffer | The FAST stream chunk to be decoded. |
[in] | offset | The index in the buffer at which decoding begins. |
[in] | count | Number of bytes to analyze during the decoding. |
[out] | message | pointer to decoded FIX Message. |
[out] | numberOfDecodedBytes | Number of bytes that contained the encoded FIX Message. |
- Warning
- message should point to an existing object. This object is not owned by Decoder and should be managed by user.
- Exceptions
-
Exception | if the decoding error is detected. |
- Returns
- 'true' if the given bytes could be decoded into a FIX message, otherwise - 'false'.
bool tryDecode |
( |
const unsigned char * |
buffer, |
|
|
size_t |
offset, |
|
|
size_t |
count, |
|
|
OnixS::FIX::Message * |
message, |
|
|
size_t * |
numberOfDecodedBytes |
|
) |
| |
static bool tryDecodeUnsignedInteger |
( |
const char * |
buffer, |
|
|
size_t |
bufferSize, |
|
|
unsigned int * |
value, |
|
|
size_t * |
fieldLength |
|
) |
| |
|
static |
Decodes the FAST-encoded unsigned integer.
- Parameters
-
buffer | Buffer that contains the FAST stream chunk to be decoded. |
bufferSize | Size of the buffer. |
value | Decoded value. |
fieldLength | Number of bytes that contained the encoded value. |
- Returns
- 'true' if the stop bit was found and the value was decoded, otherwise - 'false'.
static bool tryDecodeUnsignedInteger |
( |
const unsigned char * |
buffer, |
|
|
size_t |
bufferSize, |
|
|
unsigned int * |
value, |
|
|
size_t * |
fieldLength |
|
) |
| |
|
static |
The documentation for this class was generated from the following file: