OnixS C++ FIX Engine  4.5.0
API Documentation
FlatMessage Class Reference

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

Public Member Functions

 FlatMessage ()
 
 FlatMessage (OnixS::FIX::ProtocolVersion::Enum protocolVersion, const char *msgType)
 
 FlatMessage (const char *rawMessage, size_t rawMessageSize, bool useZeroCopyBuffer=true)
 
 FlatMessage (OnixS::FIX::ProtocolVersion::Enum protocolVersion, const char *msgType, const char *senderCompId, const char *targetCompId, const char *rawMessageWithoutHeaderTrailer, size_t rawMessageWithoutHeaderTrailerSize, bool useZeroCopyBuffer=true)
 
 FlatMessage (const OnixS::FIX::Message &message, bool useZeroCopyBuffer=true)
 
 FlatMessage (const FlatMessage &other)
 
 ~FlatMessage ()
 
const char * chars () const
 
size_t size () const
 
std::string toString () const
 
FlatFieldRef find (Tag) const
 
FlatFieldRef find (Tag, const FlatFieldRef &) const
 
FlatFieldKey allocateKey (const FlatFieldRef &)
 
FlatFieldKey allocateKey (Tag)
 
StringRef operator[] (const FlatFieldRef &) const
 
StringRef operator[] (FlatFieldKey) const
 
FlatMessageset (FlatFieldRef &, const StringRef &)
 
FlatMessageset (FlatFieldKey, const StringRef &)
 
FlatMessageset (FlatFieldRef &, Char)
 
FlatMessageset (FlatFieldKey, Char)
 
FlatMessageset (FlatFieldRef &, Int32)
 
FlatMessageset (FlatFieldKey, Int32)
 
FlatMessageset (FlatFieldRef &, UInt32)
 
FlatMessageset (FlatFieldKey, UInt32)
 
FlatMessageset (FlatFieldRef &, Int64)
 
FlatMessageset (FlatFieldKey, Int64)
 
FlatMessageset (FlatFieldRef &, UInt64)
 
FlatMessageset (FlatFieldKey, UInt64)
 
FlatMessageset (FlatFieldRef &, const Decimal &)
 
FlatMessageset (FlatFieldKey, const Decimal &)
 
FlatMessageset (FlatFieldRef &, const Timestamp &, TimestampFormat::Enum)
 
FlatMessageset (FlatFieldKey, const Timestamp &, TimestampFormat::Enum)
 
FlatMessageset (FlatFieldRef &, const TimeSpan &, TimeSpanFormat::Enum)
 
FlatMessageset (FlatFieldKey, const TimeSpan &, TimeSpanFormat::Enum)
 
FlatMessageadd (Tag, const StringRef &)
 
FlatMessageadd (Tag, Char)
 
FlatMessageadd (Tag, Int32)
 
FlatMessageadd (Tag, UInt32)
 
FlatMessageadd (Tag, Int64)
 
FlatMessageadd (Tag, UInt64)
 
FlatMessageadd (Tag, const Decimal &)
 
FlatMessageadd (Tag, const Timestamp &, TimestampFormat::Enum)
 
FlatMessageadd (Tag, const TimeSpan &, TimeSpanFormat::Enum)
 
FlatMessageremove (Tag)
 
void adjust ()
 
void reset (const char *rawMessage, size_t rawMessageSize)
 
void reset ()
 
ProtocolVersion::Enum version () const
 
FlatMessageoperator= (const FlatMessage &)
 

Friends

class MessageOperator
 
class FlatMessageWrapper
 

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 flat message (tag=value) into the valid state, it's necessary to invoke the 'adjust' member.

Definition at line 51 of file FlatMessage.h.

Constructor & Destructor Documentation

Constructs blank instance.

Note
This constructor does not support the zero-copy feature.
FlatMessage ( OnixS::FIX::ProtocolVersion::Enum  protocolVersion,
const char *  msgType 
)

Constructs an instance with empty required message header fields.

Note
This constructor does not support the zero-copy feature.
FlatMessage ( const char *  rawMessage,
size_t  rawMessageSize,
bool  useZeroCopyBuffer = true 
)

Constructs an instance from the tag=value form.

FlatMessage ( OnixS::FIX::ProtocolVersion::Enum  protocolVersion,
const char *  msgType,
const char *  senderCompId,
const char *  targetCompId,
const char *  rawMessageWithoutHeaderTrailer,
size_t  rawMessageWithoutHeaderTrailerSize,
bool  useZeroCopyBuffer = true 
)

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

Required fields will be added during the construction.

FlatMessage ( const OnixS::FIX::Message message,
bool  useZeroCopyBuffer = true 
)

Constructs an instance from the given Message object.

FlatMessage ( const FlatMessage other)

Initializes as a copy of the given instance.

Utilizes internal resources.

Member Function Documentation

FlatMessage& add ( Tag  ,
const StringRef  
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
Char   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
Int32   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
UInt32   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
Int64   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
UInt64   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
const Decimal  
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
const Timestamp ,
TimestampFormat::Enum   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& add ( Tag  ,
const TimeSpan ,
TimeSpanFormat::Enum   
)

Adds the field value to the end of the message.

Note
This method does not support the zero-copy feature.
void adjust ( )

Updates BodyLength and CheckSum fields.

FlatFieldKey allocateKey ( const FlatFieldRef )

Allocates a key to the requested field for further access.

FlatFieldKey allocateKey ( Tag  )

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

const char* chars ( ) const

Returns the content of the flat message.

FlatFieldRef 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 298 of file FlatMessage.h.

FlatFieldRef find ( Tag  ,
const FlatFieldRef  
) 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.
FlatMessage& operator= ( const FlatMessage )

Re-initializes as a copy of the given instance.

StringRef operator[] ( const FlatFieldRef ) const

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

StringRef operator[] ( FlatFieldKey  ) const

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

FlatMessage& remove ( Tag  )

Removes the field value.

Once value is removed, all references to other fields become invalid.

Note
This method does not support the zero-copy feature.
void reset ( const char *  rawMessage,
size_t  rawMessageSize 
)

Resets the instance to the new tag=value form.

Note
This method does not support the zero-copy feature.
void reset ( )

Resets the instance to the blank state.

Note
This method does not support the zero-copy feature.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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.
FlatMessage& set ( FlatFieldKey  ,
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.
FlatMessage& set ( FlatFieldRef ,
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..

Updates the field value.

Note
Once the value is updated, only the reference used to access the field remains valid, other references become invalid.
FlatMessage& set ( FlatFieldRef ,
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..
FlatMessage& set ( FlatFieldKey  ,
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 flat content.

std::string toString ( ) const

Returns a string that represents the flat message.

ProtocolVersion::Enum version ( ) const

Friends And Related Function Documentation

friend class FlatMessageWrapper
friend

Definition at line 286 of file FlatMessage.h.

friend class MessageOperator
friend

Definition at line 285 of file FlatMessage.h.


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