OnixS C++ FIX Engine  4.1.0
API Documentation
SerializedMessage Class Reference

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

Public Member Functions

 SerializedMessage (const char *rawMessage, size_t rawMessageSize)
 
 SerializedMessage (OnixS::FIX::ProtocolVersion::Enum protocolVersion, const char *msgType, const char *senderCompId, const char *targetCompId, const char *rawMessageWithoutHeaderTrailer, size_t rawMessageWithoutHeaderTrailerSize)
 
 SerializedMessage (const OnixS::FIX::Message &message)
 
 SerializedMessage (const SerializedMessage &other)
 
 ~SerializedMessage ()
 
const char * chars () const
 
size_t size () const
 
std::string toString () const
 
SerializedFieldRef find (Tag) const
 
SerializedFieldRef find (Tag, const SerializedFieldRef &) const
 
SerializedFieldKey allocateKey (const SerializedFieldRef &)
 
SerializedFieldKey allocateKey (Tag)
 
StringRef operator[] (const SerializedFieldRef &) const
 
StringRef operator[] (SerializedFieldKey) const
 
void set (SerializedFieldRef &, const StringRef &)
 
void set (SerializedFieldKey, const StringRef &)
 
void set (SerializedFieldRef &, Char)
 
void set (SerializedFieldKey, Char)
 
void set (SerializedFieldRef &, Int32)
 
void set (SerializedFieldKey, Int32)
 
void set (SerializedFieldRef &, UInt32)
 
void set (SerializedFieldKey, UInt32)
 
void set (SerializedFieldRef &, Int64)
 
void set (SerializedFieldKey, Int64)
 
void set (SerializedFieldRef &, UInt64)
 
void set (SerializedFieldKey, UInt64)
 
void set (SerializedFieldRef &, const Decimal &)
 
void set (SerializedFieldKey, const Decimal &)
 
void set (SerializedFieldRef &, const Timestamp &, TimestampFormat::Enum)
 
void set (SerializedFieldKey, const Timestamp &, TimestampFormat::Enum)
 
void set (SerializedFieldRef &, const TimeSpan &, TimeSpanFormat::Enum)
 
void set (SerializedFieldKey, const TimeSpan &, TimeSpanFormat::Enum)
 
void adjust ()
 
SerializedMessageoperator= (const SerializedMessage &)
 

Friends

class MessageOperator
 
class SerializedMessageWrapper
 

Detailed Description

Fields can be accessed using temporary field references and using special keys which remain constant during lifetime of the single instance.

To access a field, a reference must be obtained using the 'find' member. 'find' member search for a field using a regular Tag identifier. If 'find' succeeds, a temporary reference is returned. That reference can be either used to modify the field or to allocate a key for that field using 'allocateKey' member. Once the key is allocated it can be used like a tag to quick access the field.

There are pre-allocated keys to access service fields like MsgType, MsgSeqNum, SendingTime, etc.

Note
BodyLength and CheckSum fields are not synchronized each time other fields are updated. Therefore, to bring the serialized message (tag=value) into the valid state, it's necessary to invoke the 'adjust' member.

Definition at line 51 of file SerializedMessage.h.

Constructor & Destructor Documentation

SerializedMessage ( const char *  rawMessage,
size_t  rawMessageSize 
)

Constructs an instance from the tag=value form.

SerializedMessage ( OnixS::FIX::ProtocolVersion::Enum  protocolVersion,
const char *  msgType,
const char *  senderCompId,
const char *  targetCompId,
const char *  rawMessageWithoutHeaderTrailer,
size_t  rawMessageWithoutHeaderTrailerSize 
)

Constructs an instance from the tag=value form without session-level fields.

Required fields will be added during the construction.

SerializedMessage ( const OnixS::FIX::Message message)

Constructs an instance from the given Message object.

Initializes as a copy of the given instance.

Utilizes internal resources.

Member Function Documentation

void adjust ( )

Updates BodyLength and CheckSum fields.

SerializedFieldKey allocateKey ( const SerializedFieldRef &  )

Allocates a key to the requested field for further access.

SerializedFieldKey allocateKey ( Tag  )

Finds and allocates a key to the requested field for further access.

const char* chars ( ) const

Returns the content of the serialized message.

SerializedFieldRef find ( Tag  tag) const
inline

Looks for a field using the given tag number.

Returns
A valid reference in case of success, otherwise - an invalid one.

Definition at line 218 of file SerializedMessage.h.

SerializedFieldRef find ( Tag  ,
const SerializedFieldRef &   
) const

Looks for a field with assumption field is located after given another field using its tag number.

Member is suitable to access same fields but from different repeating group instances.

Returns
A valid reference in case of success, otherwise - an invalid one.
SerializedMessage& operator= ( const SerializedMessage )

Re-initializes as a copy of the given instance.

StringRef operator[] ( const SerializedFieldRef &  ) const

Provides access to a field value by the given temporary reference.

StringRef operator[] ( SerializedFieldKey  ) const

Provides access to a field value by the given field key.

void set ( SerializedFieldRef &  ,
const StringRef  
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
const StringRef  
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
Char   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
Char   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
Int32   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
Int32   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
UInt32   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
UInt32   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
Int64   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
Int64   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
UInt64   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
UInt64   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
const Decimal  
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldKey  ,
const Decimal  
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
const Timestamp ,
TimestampFormat::Enum   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid..
void set ( SerializedFieldKey  ,
const Timestamp ,
TimestampFormat::Enum   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
void set ( SerializedFieldRef &  ,
const TimeSpan ,
TimeSpanFormat::Enum   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid..
void set ( SerializedFieldKey  ,
const TimeSpan ,
TimeSpanFormat::Enum   
)

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
size_t size ( ) const

Size of the serialized content.

std::string toString ( ) const

Returns a string that represents the serialized message.

Friends And Related Function Documentation

friend class MessageOperator
friend

Definition at line 208 of file SerializedMessage.h.

friend class SerializedMessageWrapper
friend

Definition at line 209 of file SerializedMessage.h.


The documentation for this class was generated from the following file: