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

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

Classes

class  ConstIterator
 

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
 
FlatGroup getGroup (const FlatFieldRef &numberOfInstancesRef) const
 
FlatFieldRef getFlatFieldRef (const StringRef &value) 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)
 
FlatMessageset (FlatFieldRef &, const FieldValueRef &)
 
FlatMessageset (FlatFieldKey, const FieldValueRef &)
 
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)
 
FlatMessageinsert (Tag, const StringRef &, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, Char, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, Int32, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, UInt32, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, Int64, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, UInt64, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, const Decimal &, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, const Timestamp &, TimestampFormat::Enum, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageinsert (Tag, const TimeSpan &, TimeSpanFormat::Enum, Tag, InsertMode::Enum=InsertMode::Before)
 
FlatMessageremove (Tag)
 
void adjust ()
 
void reset (const char *rawMessage, size_t rawMessageSize)
 
void reset ()
 
ProtocolVersion::Enum version () const
 
void * userData () const
 
void userData (void *data)
 
FlatMessageoperator= (const FlatMessage &)
 
ConstIterator begin () const
 
ConstIterator end () const
 

Friends

class MessageOperator
 
class FlatMessageWrapper
 

Detailed Description

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

To access a field, a reference must be obtained using the 'find' member. The 'find' member searches for a field using a regular Tag identifier. If the '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 the '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 88 of file FlatMessage.h.

Constructor & Destructor Documentation

Constructs the 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 tag/value pair to the end of the message.

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

Adds the tag/value pair to the end of the message.

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

Adds the tag/value pair to the end of the message.

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

Adds the tag/value pair to the end of the message.

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

Adds the tag/value pair to the end of the message.

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

Adds the tag/value pair to the end of the message.

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

Adds the tag/value pair 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 tag/value pair 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 tag/value pair 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 the further access.

FlatFieldKey allocateKey ( Tag  )

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

ConstIterator begin ( ) const

Returns the constant iterator to the first field in the FlatMessage instance.

const char* chars ( ) const

Returns the content of the flat message.

ConstIterator end ( ) const

Returns the constant iterator to the field after the last one in the FlatMessage instance.

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

FlatFieldRef find ( Tag  ,
const FlatFieldRef  
) const

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

The 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.
FlatFieldRef getFlatFieldRef ( const StringRef value) const

Converts the StringRef value of the given FlatMessage to the FlatFieldRef object.

FlatGroup getGroup ( const FlatFieldRef numberOfInstancesRef) const

Returns the reference to a repeating group - if exists.

Parameters
numberOfInstancesRefThe reference of the field that defines the number of instances in this repeating group (the NoXXX field).
Exceptions
std::exceptionif the given field does not contain the number of instances.
FlatMessage& insert ( Tag  ,
const StringRef ,
Tag  ,
InsertMode::Enum  = InsertMode::Before 
)

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& insert ( Tag  ,
Char  ,
Tag  ,
InsertMode::Enum  = InsertMode::Before 
)

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& insert ( Tag  ,
const Decimal ,
Tag  ,
InsertMode::Enum  = InsertMode::Before 
)

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.

Inserts the tag/value pair to the message before or after the position field.

If the position tag is not found, it adds the tag/value pair to the end of the message.

Note
This method does not support the zero-copy feature.
FlatMessage& operator= ( const FlatMessage )

Re-initializes as a copy of the given instance.

StringRef operator[] ( const FlatFieldRef ) const

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

StringRef operator[] ( FlatFieldKey  ) const

Provides an 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.
FlatMessage& set ( FlatFieldRef ,
const FieldValueRef  
)

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

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

The size of the flat content.

std::string toString ( ) const

Returns a string that represents the flat message.

void* userData ( ) const

A user data associated with the message.

Returns
A pointer to data was previously attached to the instance or NULL.
void userData ( void *  data)

Attaches a user data to the message.

ProtocolVersion::Enum version ( ) const

Friends And Related Function Documentation

friend class FlatMessageWrapper
friend

Definition at line 449 of file FlatMessage.h.

friend class MessageOperator
friend

Definition at line 448 of file FlatMessage.h.


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