OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
FlatMessage Class Reference

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 ()
bool valid () const
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)
void swap (FlatMessage &other) ONIXS_FIXENGINE_NOTHROW
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 109 of file FlatMessage.h.

Constructor & Destructor Documentation

◆ FlatMessage() [1/6]

Constructs the blank instance.

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

◆ FlatMessage() [2/6]

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() [3/6]

FlatMessage ( const char * rawMessage,
size_t rawMessageSize,
bool useZeroCopyBuffer = true )

Constructs an instance from the tag=value form.

◆ FlatMessage() [4/6]

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() [5/6]

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

Constructs an instance from the given Message object.

◆ FlatMessage() [6/6]

FlatMessage ( const FlatMessage & other)

Initializes as a copy of the given instance.

◆ ~FlatMessage()

Utilizes internal resources.

Member Function Documentation

◆ add() [1/9]

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.

◆ add() [2/9]

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.

◆ add() [3/9]

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.

◆ add() [4/9]

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.

◆ add() [5/9]

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

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

◆ add() [6/9]

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.

◆ add() [7/9]

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.

◆ add() [8/9]

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.

◆ add() [9/9]

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.

◆ adjust()

void adjust ( )

Updates BodyLength and CheckSum fields.

◆ allocateKey() [1/2]

FlatFieldKey allocateKey ( const FlatFieldRef & )

Allocates a key to the requested field for the further access.

◆ allocateKey() [2/2]

FlatFieldKey allocateKey ( Tag )

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

◆ begin()

ConstIterator begin ( ) const

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

◆ chars()

const char * chars ( ) const

Returns the content of the flat message.

◆ end()

ConstIterator end ( ) const

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

◆ find() [1/2]

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

◆ find() [2/2]

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.

◆ getFlatFieldRef()

FlatFieldRef getFlatFieldRef ( const StringRef & value) const

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

◆ getGroup()

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.

◆ insert() [1/9]

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.

◆ insert() [2/9]

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.

◆ insert() [3/9]

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.

◆ insert() [4/9]

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.

◆ insert() [5/9]

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.

◆ insert() [6/9]

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.

◆ insert() [7/9]

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.

◆ insert() [8/9]

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.

◆ insert() [9/9]

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.

◆ operator=()

FlatMessage & operator= ( const FlatMessage & )

Re-initializes as a copy of the given instance.

◆ operator[]() [1/2]

StringRef operator[] ( const FlatFieldRef & ) const

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

◆ operator[]() [2/2]

StringRef operator[] ( FlatFieldKey ) const

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

◆ remove()

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.

◆ reset() [1/2]

void reset ( )

Resets the instance to the blank state.

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

◆ reset() [2/2]

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.

◆ set() [1/20]

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.

◆ set() [2/20]

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.

◆ set() [3/20]

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.

◆ set() [4/20]

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.

◆ set() [5/20]

Updates the field value.

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

◆ set() [6/20]

Updates the field value.

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

◆ set() [7/20]

Updates the field value.

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

◆ set() [8/20]

Updates the field value.

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

◆ set() [9/20]

Updates the field value.

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

◆ set() [10/20]

Updates the field value.

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

◆ set() [11/20]

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.

◆ set() [12/20]

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.

◆ set() [13/20]

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.

◆ set() [14/20]

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.

◆ set() [15/20]

Updates the field value.

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

◆ set() [16/20]

Updates the field value.

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

◆ set() [17/20]

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.

◆ set() [18/20]

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.

◆ set() [19/20]

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.

◆ set() [20/20]

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.

◆ size()

size_t size ( ) const

The size of the flat content.

◆ swap()

void swap ( FlatMessage & other)

Swaps the content with another instance.

◆ toString()

std::string toString ( ) const

Returns a string that represents the flat message.

◆ userData() [1/2]

void * userData ( ) const

A user data associated with the message.

Returns
A pointer to data was previously attached to the instance or NULL.

◆ userData() [2/2]

void userData ( void * data)

Attaches a user data to the message.

◆ valid()

bool valid ( ) const

Indicates whether an instance refers to a valid set of fields.

If the given instance doesn't refer to a valid fields set, none of other members must be used.

◆ version()

ProtocolVersion::Enum version ( ) const

◆ FlatMessageWrapper

friend class FlatMessageWrapper
friend

Definition at line 499 of file FlatMessage.h.

◆ MessageOperator

friend class MessageOperator
friend

Definition at line 498 of file FlatMessage.h.