OnixS C++ FIX Engine  4.3.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 41 of file EventBasedDecoder.h.

Constructor & Destructor Documentation

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

Creates FAST Decoder.

Parameters
xmlTemplatesXML-based FAST templates.
fixVersionFIX Protocol version.
decodeEachMessageIndependentlyOption 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.
fixDictionaryCustomized FIX dictionary used for decoded messages
decodeEachMessageIndependentlyOption 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 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
xmlTemplatesXML-based FAST templates.
decodeEachMessageIndependentlyOption 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 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
baseVersionVersion of FIX protocol which dictionary becomes base for the newly generated FIX dictionary.
xmlTemplatesXML-based FAST templates used to generate FIX dictionary. This FIX dictionary takes generic identifier generated on base of the XML contanet and baseVersion
decodeEachMessageIndependentlyOption 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 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
baseVersionVersion of FIX protocol which dictionary becomes base for the newly generated FIX dictionary.
xmlTemplatesXML-based FAST templates.
genericFixDictionaryIdIdentifier which is applied to generic FIX dictionary. This FIX dictionary is generated using xmlTemplates and baseVersion.
decodeEachMessageIndependentlyOption 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  )

Destructor.

Member Function Documentation

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

Decodes the given FAST stream chunk.

Parameters
bufferBuffer that contains the FAST stream chunk to be decoded.
bufferSizeSize of the buffer.
listenerListener which receives decoding events.
usedSizeNumber of sequential bytes in the chunk which were recognized as FAST-encoded messages.
Exceptions
Exceptionif 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.
listenerListener which receives decoding events.
usedSizeNumber of sequential bytes in the chunk which were recognized as FAST-encoded messages.
Exceptions
Exceptionif 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 just a first message from given FAST stream chunk.

Parameters
bufferBuffer that contains the FAST stream chunk to be decoded.
bufferSizeSize of the buffer.
listenerListener which receives decoding events.
usedSizeNumber of sequential bytes in the chunk which were recognized as FAST-encoded message.
Exceptions
Exceptionif 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 just a first message from given FAST stream chunk.

Parameters
chunkThe FAST stream chunk to be decoded.
listenerListener which receives decoding events.
usedSizeNumber of sequential bytes in the chunk which were recognized as FAST-encoded message.
Exceptions
Exceptionif 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

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.
InputDataTraits::Enum inputDataTraits ( ) const

Input data traits of the decoder.

Returns
Input data traits provided during 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
bufferBuffer that contains the FAST stream chunk to be decoded.
bufferSizeSize of the buffer.
valueDecoded value.
fieldLengthNumber 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: