OnixS C++ FIX Engine  4.12.0
API Documentation
EventBasedDecoder Class Reference

#include <OnixS/FIXEngine/FIX/EventBasedDecoder.h>

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 ( 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 ( 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 ( 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 ( 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 ( 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 ( void  )

The destructor.

Member Function Documentation

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.
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 
)

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.
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 
)

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.
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 
)

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.
bool decodeSingleMessage ( const OnixS::Sockets::Bytes chunk,
IDecodeListener listener,
size_t *  usedSize 
)
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::Enum inputDataTraits ( ) const

Input data traits of the decoder.

Returns
Input data traits provided during the construction of the decoder.
void reset ( )

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

See also
decodeEachMessageIndependently.
static 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'.
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: