#include <OnixS/FIXEngine/FIX/SBE.h>
|
| Decoder (const std::string &xmlTemplates, const OnixS::FIX::Dictionary &fixDictionary, ISbeCustomCoderLibrary *customCoders=ONIXS_FIXENGINE_NULLPTR) |
|
| Decoder (const std::string &xmlTemplates, ISbeCustomCoderLibrary *customCoders=ONIXS_FIXENGINE_NULLPTR) |
|
| Decoder (ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, ISbeCustomCoderLibrary *customCoders=ONIXS_FIXENGINE_NULLPTR) |
|
| ~Decoder () |
|
const OnixS::FIX::Message & | decode (int templateId, int version, size_t rootBlockLength, const unsigned char *buffer, size_t bufferSize, size_t *numberOfDecodedBytes=ONIXS_FIXENGINE_NULLPTR) const |
|
const OnixS::FIX::Message & | decode (const unsigned char *buffer, size_t bufferSize, size_t *numberOfDecodedBytes=ONIXS_FIXENGINE_NULLPTR, int *templateId=ONIXS_FIXENGINE_NULLPTR, int *version=ONIXS_FIXENGINE_NULLPTR) const |
|
bool | tryDecode (int templateId, int version, size_t rootBlockLength, const unsigned char *buffer, size_t offset, size_t count, OnixS::FIX::Message *message, size_t *numberOfDecodedBytes) const |
|
OnixS::FIX::Dictionary | fixDictionary () const |
|
void | maximumNumberOfRepeatingGroupEntries (int value) |
|
int | maximumNumberOfRepeatingGroupEntries () const |
|
unsigned | schemaVersion () const |
|
unsigned | schemaId () const |
|
std::string | schemaSemanticVersion () const |
|
std::string | schemaHeaderType () const |
|
Definition at line 97 of file SBE.h.
Creates a SBE to FIX Decoder.
- Parameters
-
xmlTemplates | XML-based SBE templates. |
fixDictionary | Customized FIX dictionary used for decoded message. |
customCoders | Custom coders library. |
Creates a SBE to FIX Decoder for FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided SBE-template content, uses FIX 4.0 as base FIX dictionary and has generic name.
- Parameters
-
xmlTemplates | XML-based SBE templates. |
customCoders | Custom coders library. |
Creates a SBE to FIX Decoder for FIX dictionary-independent mode.
The generic FIX dictionary is created by the provided SBE-template content, uses specified FIX dictionary as base and has generic name.
- Parameters
-
baseVersion | Version of FIX protocol which dictionary becomes base for the newly generated FIX dictionary. |
xmlTemplates | XML-based SBE templates used to generate FIX dictionary. This FIX dictionary takes generic identifier generated on base of the XML contanet and baseVersion |
customCoders | Custom coders library. |
const OnixS::FIX::Message& decode |
( |
int |
templateId, |
|
|
int |
version, |
|
|
size_t |
rootBlockLength, |
|
|
const unsigned char * |
buffer, |
|
|
size_t |
bufferSize, |
|
|
size_t * |
numberOfDecodedBytes = ONIXS_FIXENGINE_NULLPTR |
|
) |
| const |
Decodes the given SBE stream chunk into the corresponding FIX Message.
- Parameters
-
[in] | templateId | Identifier of the SBE template, used to decode the input data. |
[in] | version | Version of the SBE schema, used to decode the input data. |
[in] | rootBlockLength | Length of the root block. This value should be extracted from the message preamble, or from other source. |
[in] | buffer | Buffer that contains the SBE stream chunk to be decoded. |
[in] | bufferSize | Size of the buffer. |
[out] | numberOfDecodedBytes | Number of bytes that contained the encoded FIX Message. |
- 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.
const OnixS::FIX::Message& decode |
( |
const unsigned char * |
buffer, |
|
|
size_t |
bufferSize, |
|
|
size_t * |
numberOfDecodedBytes = ONIXS_FIXENGINE_NULLPTR , |
|
|
int * |
templateId = ONIXS_FIXENGINE_NULLPTR , |
|
|
int * |
version = ONIXS_FIXENGINE_NULLPTR |
|
) |
| const |
Decodes the given SBE stream chunk into the corresponding FIX Message using message header.
This method decodes the given SBE stream chunk using the message header decoder that was built on the base of the SBE template.
- Parameters
-
[in] | buffer | Buffer that contains the SBE stream chunk to be decoded. |
[in] | bufferSize | Size of the buffer. |
[out] | numberOfDecodedBytes | Number of bytes that contained the encoded FIX Message. |
[out] | templateId | Identifier of the SBE template, that was used to decode the input data. |
[out] | version | Version of the SBE schema, that was used to decode the input data. |
- 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 Dictionary generateFixDictionary |
( |
const std::string & |
sbeTemplateXml | ) |
|
|
static |
Generates FIX dictionary XML.
- Parameters
-
[in] | sbeTemplateXml | XML content of SBE template (the same as used to initialize Decoder). |
Generates FIX dictionary XML.
- Parameters
-
[in] | sbeTemplateXml | XML content of SBE template (the same as used to initialize Decoder). |
[in] | baseVersion | Version of FIX protocol which dictionary becomes base for the newly generated FIX dictionary. |
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.
std::string schemaHeaderType |
( |
| ) |
const |
Name of the encoding type of the message header, which is the same for all messages in a schema.
unsigned schemaId |
( |
| ) |
const |
std::string schemaSemanticVersion |
( |
| ) |
const |
Semantic version of the SBE schema.
unsigned schemaVersion |
( |
| ) |
const |
Maximum known version of the SBE schema.
bool tryDecode |
( |
int |
templateId, |
|
|
int |
version, |
|
|
size_t |
rootBlockLength, |
|
|
const unsigned char * |
buffer, |
|
|
size_t |
offset, |
|
|
size_t |
count, |
|
|
OnixS::FIX::Message * |
message, |
|
|
size_t * |
numberOfDecodedBytes |
|
) |
| const |
Tries to decode the given SBE stream buffer into the corresponding FIX Message.
- Parameters
-
[in] | templateId | Identifier of the SBE template, used to decode the input data. |
[in] | version | Version of the SBE schema, used to decode the input data. |
[in] | rootBlockLength | Length of the root block. This value should be extracted from the message preamble, or from other source. |
[in] | buffer | The SBE 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'.
The documentation for this class was generated from the following file:
- OnixS/FIXEngine/FIX/SBE.h