OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
EventBasedDecoder Class Reference

Public Member Functions

 EventBasedDecoder (const std::string &xmlTemplates, ProtocolVersion::Enum fixVersion, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
 EventBasedDecoder (const std::string &xmlTemplates, const OnixS::FIX::Dictionary &fixDictionary, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
 EventBasedDecoder (const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
 EventBasedDecoder (ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
 EventBasedDecoder (ProtocolVersion::Enum baseVersion, const std::string &xmlTemplates, const std::string &genericFixDictionaryId, bool decodeEachMessageIndependently, InputDataTraits::Enum inputDataTraits)
 ~EventBasedDecoder (void)
InputDataTraits::Enum inputDataTraits () const
bool decode (const char *buffer, size_t bufferSize, IDecodeListener *listener, size_t *usedSize)
bool decode (const unsigned char *buffer, size_t bufferSize, IDecodeListener *listener, size_t *usedSize)
bool decode (const std::vector< char > &chunk, IDecodeListener *listener, size_t *usedSize)
bool decode (const OnixS::Sockets::Bytes &chunk, IDecodeListener *listener, size_t *usedSize)
bool decodeSingleMessage (const char *buffer, size_t bufferSize, IDecodeListener *listener, size_t *usedSize)
bool decodeSingleMessage (const unsigned char *buffer, size_t bufferSize, IDecodeListener *listener, size_t *usedSize)
bool decodeSingleMessage (const std::vector< char > &chunk, IDecodeListener *listener, size_t *usedSize)
bool decodeSingleMessage (const OnixS::Sockets::Bytes &chunk, IDecodeListener *listener, size_t *usedSize)
void reset ()
OnixS::FIX::Dictionary fixDictionary () 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)

Detailed Description

Definition at line 40 of file EventBasedDecoder.h.

Constructor & Destructor Documentation

◆ EventBasedDecoder() [1/5]

EventBasedDecoder ( const std::string & xmlTemplates,
ProtocolVersion::Enum fixVersion,
bool decodeEachMessageIndependently,
InputDataTraits::Enum inputDataTraits )

Creates a FAST Decoder.

Parameters
xmlTemplatesXML-based FAST templates.
fixVersionThe FIX Protocol version.
decodeEachMessageIndependentlyThe option to reset the previous values dictionaries before decoding a new FAST stream chunk.
inputDataTraitsTraits of input data, has effect only when decodeEachMessageIndependently is false. See InputDataTraits::Enum for details.

◆ EventBasedDecoder() [2/5]

EventBasedDecoder ( const std::string & xmlTemplates,
const OnixS::FIX::Dictionary & fixDictionary,
bool decodeEachMessageIndependently,
InputDataTraits::Enum inputDataTraits )

Creates a FAST Decoder.

Parameters
xmlTemplatesXML-based FAST templates.
fixDictionaryThe customized FIX dictionary used for decoded messages
decodeEachMessageIndependentlyThe option to reset the previous values dictionaries before decoding a new FAST stream chunk.
inputDataTraitsTraits of input data, has effect only when decodeEachMessageIndependently is false. See InputDataTraits::Enum for details.

◆ EventBasedDecoder() [3/5]

EventBasedDecoder ( 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.

Parameters
xmlTemplatesXML-based FAST templates.
decodeEachMessageIndependentlyThe option to reset the previous values dictionaries before decoding a new FAST stream chunk.
inputDataTraitsTraits of input data, has effect only when decodeEachMessageIndependently is false. See InputDataTraits::Enum for details.

◆ EventBasedDecoder() [4/5]

EventBasedDecoder ( ProtocolVersion::Enum baseVersion,
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.

Parameters
baseVersionThis version of the FIX protocol becomes the base for the newly generated FIX dictionary.
xmlTemplatesXML-based FAST templates to generate the FIX dictionary. This FIX dictionary takes a generic identifier generated on a base of the XML content and baseVersion
decodeEachMessageIndependentlyThe option to reset the previous values dictionaries before decoding a new FAST stream chunk.
inputDataTraitsTraits of input data, has effect only when decodeEachMessageIndependently is false. See InputDataTraits::Enum for details.

◆ EventBasedDecoder() [5/5]

EventBasedDecoder ( ProtocolVersion::Enum baseVersion,
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.

Note
The new FIX dictionary instance will be generated if and only if there is no a FIX dictionary with the same name.
Parameters
baseVersionThis version of the FIX protocol becomes the base for the newly generated FIX dictionary.
xmlTemplatesXML-based FAST templates.
genericFixDictionaryIdThe identifier which is applied to the generic FIX dictionary. This FIX dictionary is generated using xmlTemplates and baseVersion.
decodeEachMessageIndependentlyThe option to reset the previous values dictionaries before decoding a new FAST stream chunk.
inputDataTraitsTraits of input data, has effect only when decodeEachMessageIndependently is false. See InputDataTraits::Enum for details.

◆ ~EventBasedDecoder()

~EventBasedDecoder ( void )

The destructor.

Member Function Documentation

◆ decode() [1/4]

bool decode ( const char * buffer,
size_t bufferSize,
IDecodeListener * listener,
size_t * usedSize )

Decodes the given FAST stream chunk.

Parameters
bufferThe buffer that contains the FAST stream chunk to be decoded.
bufferSizeThe size of the buffer.
listenerThe listener which receives decoding events.
usedSizeThe number of sequential bytes in the chunk which were recognized as FAST-encoded messages.
Exceptions
Anexception if the message cannot be decoded.
Returns
true if at least a single message was successfully decoded.

◆ decode() [2/4]

bool decode ( const OnixS::Sockets::Bytes & chunk,
IDecodeListener * listener,
size_t * usedSize )

◆ decode() [3/4]

bool decode ( const std::vector< char > & chunk,
IDecodeListener * listener,
size_t * usedSize )

Decodes the given FAST stream chunk.

Parameters
chunkThe FAST stream chunk to be decoded.
listenerThe listener which receives decoding events.
usedSizeThe number of sequential bytes in the chunk which were recognized as FAST-encoded messages.
Exceptions
Anexception if the message cannot be decoded.
Returns
true if at least a single message was successfully decoded.

◆ decode() [4/4]

bool decode ( const unsigned char * buffer,
size_t bufferSize,
IDecodeListener * listener,
size_t * usedSize )

◆ decodeSingleMessage() [1/4]

bool decodeSingleMessage ( const char * buffer,
size_t bufferSize,
IDecodeListener * listener,
size_t * usedSize )

Decodes the first message from the given FAST stream chunk.

Parameters
bufferThe buffer that contains the FAST stream chunk to be decoded.
bufferSizeThe size of the buffer.
listenerThe listener which receives decoding events.
usedSizeThe number of sequential bytes in the chunk which were recognized as a FAST-encoded message.
Exceptions
Anexception if the message cannot be decoded.
Returns
true if the message was successfully decoded.

◆ decodeSingleMessage() [2/4]

bool decodeSingleMessage ( const OnixS::Sockets::Bytes & chunk,
IDecodeListener * listener,
size_t * usedSize )

◆ decodeSingleMessage() [3/4]

bool decodeSingleMessage ( const std::vector< char > & chunk,
IDecodeListener * listener,
size_t * usedSize )

Decodes the first message from the given FAST stream chunk.

Parameters
chunkThe FAST stream chunk to be decoded.
listenerThe listener which receives decoding events.
usedSizeThe number of sequential bytes in the chunk which were recognized as a FAST-encoded message.
Exceptions
Anexception if the message cannot be decoded.
Returns
true if the message was successfully decoded.

◆ decodeSingleMessage() [4/4]

bool decodeSingleMessage ( const unsigned char * buffer,
size_t bufferSize,
IDecodeListener * listener,
size_t * usedSize )

◆ fixDictionary()

OnixS::FIX::Dictionary fixDictionary ( ) const

The FIX dictionary used by the decoder instance.

Returns
The FIX dictionary currently used by the decoder instance. If the decoder was initialized with the FIX dictionary-independent mode, the method returns a reference to the internally generated FIX dictionary.

◆ inputDataTraits()

InputDataTraits::Enum inputDataTraits ( ) const

Input data traits of the decoder.

Returns
Input data traits provided during the construction of the decoder.

◆ reset()

void reset ( )

Resets the state of the previous values dictionaries (sets the state of the previous values to undefined).

See also
decodeEachMessageIndependently.

◆ tryDecodeUnsignedInteger() [1/2]

bool tryDecodeUnsignedInteger ( const char * buffer,
size_t bufferSize,
unsigned int * value,
size_t * fieldLength )
static

Decodes the FAST-encoded unsigned integer.

Parameters
bufferThe buffer that contains the FAST stream chunk to be decoded.
bufferSizeThe size of the buffer.
valueThe decoded value.
fieldLengthThe number of bytes that contained the encoded value.
Returns
'true' if the stop bit was found and the value was decoded, otherwise - 'false'.

◆ tryDecodeUnsignedInteger() [2/2]

bool tryDecodeUnsignedInteger ( const unsigned char * buffer,
size_t bufferSize,
unsigned int * value,
size_t * fieldLength )
static