B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Engine::FIXMessageEx Class Reference

The part of the FIX message storing persistent data and helpers. More...

#include <FIXMessageEx.h>

+ Inheritance diagram for Engine::FIXMessageEx:
+ Collaboration diagram for Engine::FIXMessageEx:

Public Member Functions

 FIXMessageEx ()
 The constructor. More...
 
System::u64 generateNewGlobalId ()
 Generates the new globalMsgID for the message. More...
 
void generateNewGlobalIdBeforeSend ()
 Generates a new globalMsgID for the message before message is sent. More...
 
bool V12_API getBinaryData (const char *&buffer, size_t &dataSize) const
 This function can be used to get original binary data of the message if it is applicable for the message and session in context. More...
 
const PersistentDatagetPersistentData () const
 Returns the persistent data from the message. More...
 
PersistentDatagetPersistentData ()
 Returns the persistent data from the message. More...
 
const PersistentUserDatagetPersistentUserData () const
 Returns the user part of the persistent data from the message. More...
 
PersistentUserDatagetPersistentUserData ()
 Returns the user part of the persistent data from the message. More...
 
System::u64 getTimestamp ()
 Returns the sending/receiving timestamp. More...
 
void * getUserData () const
 Returns user data attached to the message instance. More...
 
bool isFromGapQueue () const
 Checks whether the message is from gap(out-of-sequence) queue. More...
 
bool needNewGlobIDBeforeSend ()
 Returns true if the message is configured to generate a new globalMsgID for the message before the message is sent. More...
 
void setNeedNewGlobIDBeforeSend (bool enable)
 Configures the message to generate a new globalMsgID for the message before the message is sent or to skip the generation. More...
 
const void setPersistentData (const PersistentData &persistentData)
 Sets the persistent data to the message. More...
 
void setPersistentUserData (const PersistentUserData &userData)
 Sets the user part of the persistent data to the message. More...
 
void setTimestamp (System::u64 timestampUsec)
 Sets the sending/receiving timestamp. More...
 
void setUserData (void *userData)
 Attaches the user data to the message instance. More...
 

Static Public Member Functions

static System::u64 getCurrGlobalMsgId ()
 Returns the last generated GlobalMsgId. More...
 
static void seedGlobalMsgId (System::u64 globalMsgId)
 Initializes the global GlobalMsgId generator with the new start value. More...
 

Public Attributes

EngineTagDataengineTagData_
 This data field is used by the engine internaly, don't process or use it!. More...
 
bool isFromGapQueue_
 Flag indicating whatever this message is from gap(out-of-sequence) queue. More...
 
uint64_t measuredLatency_
 This data field is used to measure latency. More...
 
bool needNewGlobIDBeforeSend_
 The Generate-a-new-globalMsgID flag. More...
 
PersistentData persistentData_
 The persistent data assigned to the message instance. More...
 
System::u64 timestampNanos_
 The sending/receiving timestamp. More...
 
void * userData_
 The user data field. More...
 

Detailed Description

The part of the FIX message storing persistent data and helpers.

Constructor & Destructor Documentation

Engine::FIXMessageEx::FIXMessageEx ( )
inline

The constructor.

References generateNewGlobalId().

Member Function Documentation

System::u64 Engine::FIXMessageEx::generateNewGlobalId ( )
inline

Generates the new globalMsgID for the message.

References Engine::g_globalMsgIdGen, Engine::PersistentData::globalMsgID, Engine::GlobalMsgIdGen::newValue(), and persistentData_.

Referenced by FIXMessageEx().

void Engine::FIXMessageEx::generateNewGlobalIdBeforeSend ( )
inline

Generates a new globalMsgID for the message before message is sent.

It is called for the LiteFixMessage as a part of the sending process.

See Also
needNewGlobIDBeforeSend()

References Engine::g_globalMsgIdGen, Engine::PersistentData::globalMsgID, needNewGlobIDBeforeSend_, Engine::GlobalMsgIdGen::newValue(), and persistentData_.

bool V12_API Engine::FIXMessageEx::getBinaryData ( const char *&  buffer,
size_t &  dataSize 
) const

This function can be used to get original binary data of the message if it is applicable for the message and session in context.

If there is no binary data false is returned and true otherwise. Please note that the pointer returned is valid until message goes out of current context(scope). So if you need this data outside of the scope the function is called copy it to separate buffer. This note is more applicable for the case when LiteFixMessage is used along with pipelining when user returns LiteFixMessage back to the pool himself. Message life time is longer than context life time in this case and the note above is applicable.

static System::u64 Engine::FIXMessageEx::getCurrGlobalMsgId ( )
inlinestatic

Returns the last generated GlobalMsgId.

References Engine::GlobalMsgIdGen::curValue(), and Engine::g_globalMsgIdGen.

const PersistentData& Engine::FIXMessageEx::getPersistentData ( ) const
inline

Returns the persistent data from the message.

References persistentData_.

Referenced by Engine::MsgPipeElem::returnObj().

PersistentData& Engine::FIXMessageEx::getPersistentData ( )
inline

Returns the persistent data from the message.

References persistentData_.

const PersistentUserData& Engine::FIXMessageEx::getPersistentUserData ( ) const
inline

Returns the user part of the persistent data from the message.

References persistentData_, and Engine::PersistentData::userData.

PersistentUserData& Engine::FIXMessageEx::getPersistentUserData ( )
inline

Returns the user part of the persistent data from the message.

References persistentData_, and Engine::PersistentData::userData.

System::u64 Engine::FIXMessageEx::getTimestamp ( )
inline

Returns the sending/receiving timestamp.

References persistentData_, and Engine::PersistentData::timestampUsec.

void* Engine::FIXMessageEx::getUserData ( ) const
inline

Returns user data attached to the message instance.

Note
The data is not processed by the engine e.g. no clone, no persist, no load

References userData_.

bool Engine::FIXMessageEx::isFromGapQueue ( ) const
inline

Checks whether the message is from gap(out-of-sequence) queue.

Returns
"true" if the message is from gap queue. "false" otherwise.

References isFromGapQueue_.

bool Engine::FIXMessageEx::needNewGlobIDBeforeSend ( )
inline

Returns true if the message is configured to generate a new globalMsgID for the message before the message is sent.

References needNewGlobIDBeforeSend_.

static void Engine::FIXMessageEx::seedGlobalMsgId ( System::u64  globalMsgId)
inlinestatic

Initializes the global GlobalMsgId generator with the new start value.

References Engine::g_globalMsgIdGen, and Engine::GlobalMsgIdGen::reset().

void Engine::FIXMessageEx::setNeedNewGlobIDBeforeSend ( bool  enable)
inline

Configures the message to generate a new globalMsgID for the message before the message is sent or to skip the generation.

Parameters
enableif it is true generation will be enabled.

References needNewGlobIDBeforeSend_.

const void Engine::FIXMessageEx::setPersistentData ( const PersistentData persistentData)
inline

Sets the persistent data to the message.

The data will be stored in the in/out sessions logs with the message.

Parameters
persistentDatadata to assign

References persistentData_.

void Engine::FIXMessageEx::setPersistentUserData ( const PersistentUserData userData)
inline

Sets the user part of the persistent data to the message.

The data will be stored in the in/out sessions logs with the message.

Parameters
userDataThe user data to assign

References persistentData_, and Engine::PersistentData::userData.

void Engine::FIXMessageEx::setTimestamp ( System::u64  timestampUsec)
inline

Sets the sending/receiving timestamp.

References persistentData_, and Engine::PersistentData::timestampUsec.

Referenced by fix_algo::reorderSMHForMiax().

void Engine::FIXMessageEx::setUserData ( void *  userData)
inline

Attaches the user data to the message instance.

Note
The data is not processed by the engine e.g. no clone, no persist, no load

References userData_.

Member Data Documentation

EngineTagData* Engine::FIXMessageEx::engineTagData_

This data field is used by the engine internaly, don't process or use it!.

bool Engine::FIXMessageEx::isFromGapQueue_

Flag indicating whatever this message is from gap(out-of-sequence) queue.

Referenced by isFromGapQueue().

uint64_t Engine::FIXMessageEx::measuredLatency_
mutable

This data field is used to measure latency.

bool Engine::FIXMessageEx::needNewGlobIDBeforeSend_

The Generate-a-new-globalMsgID flag.

See Also
setNeedNewGlobIDBeforeSend( enable )
needNewGlobIDBeforeSend()

Referenced by generateNewGlobalIdBeforeSend(), needNewGlobIDBeforeSend(), and setNeedNewGlobIDBeforeSend().

PersistentData Engine::FIXMessageEx::persistentData_
System::u64 Engine::FIXMessageEx::timestampNanos_

The sending/receiving timestamp.

void* Engine::FIXMessageEx::userData_

The user data field.

See Also
setUserData(userData)
getUserData()

Referenced by getUserData(), and setUserData().