OnixS Xetra MDI Market Data Handler for C++  1.0.0.0
Public Member Functions | Friends | List of all members
Message Class Reference

Encapsulates operations over a FIX Message. More...

Public Member Functions

 Message (const Message &other)
 Initializes instance as deep copy of other one. More...
 
 ~Message ()
 Disposes all internal data structures. More...
 
FieldValueRef type () const
 Returns the message type (MsgType(35) field value).
 
SequenceNumber seqNum () const
 Returns the message sequence number (the MsgSeqNum (tag=34) field value). More...
 
FieldValueRef senderCompId () const
 Returns the assigned value used to identify firm sending message (SenderCompID (49) field value). More...
 
bool operator== (const Message &) const
 Compares two messages. More...
 
bool operator!= (const Message &) const
 Compares two messages. More...
 
std::string toString (char delimiter=0x1, MessageStringingFlags flags=MessageStringingFlag::IncludeFieldTagNumber) const
 Returns the string representation of the message using the given delimiter and additional control flags. More...
 
std::string toStringWithFieldNames () const
 Returns the string representation of the message with field names using 0x1 delimiter. More...
 
void toString (std::string &str, char delimiter=0x1, MessageStringingFlags flags=MessageStringingFlag::IncludeFieldTagNumber) const
 Appends string representation of the message using the given delimiter and additional control flags. More...
 
Messageoperator= (const Message &)
 
- Public Member Functions inherited from FieldSet
 operator bool () const
 Indicates whether instance refers to a valid set of fields. More...
 
FieldValueRef get (Tag tag) const
 Returns reference to a given field value. More...
 
Int32 getInt32 (Tag tag) const
 Returns field value as an OnixS::FIX::Int32 value. More...
 
UInt32 getUInt32 (Tag tag) const
 Returns field value as an OnixS::FIX::UInt32 value. More...
 
Int64 getInt64 (Tag tag) const
 Returns field value as an OnixS::FIX::Int64 value. More...
 
UInt64 getUInt64 (Tag tag) const
 Returns field value as an OnixS::FIX::UInt64 value. More...
 
Decimal getDecimal (Tag tag) const
 Returns the field value as a decimal number. More...
 
StringRef getStringRef (Tag tag) const
 Returns reference to a read-only text chain. More...
 
Timestamp getTimestamp (Tag tag, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
 Returns the field value as timestamp of requested format. More...
 
Group getGroup (Tag numberOfInstancesTag) const
 Returns reference to a repeating group if underlying field defines length of repeating group. More...
 
Group getOptionalGroup (Tag numberOfInstancesTag) const
 Returns reference to a repeating group if underlying field defines length of repeating group. More...
 
bool hasFlag (Tag tag) const
 Returns true if the given flag is present and it equals to "Y", otherwise false. More...
 
template<typename Enumeration >
Enumeration::Enum getIntEnumFieldValue (Tag tag) const
 
template<typename Enumeration >
Enumeration::Enum getCharEnumFieldValue (Tag tag) const
 

Friends

class MessageOperator
 
class Snapshot
 
class Incremental
 
class ExchFastMrktReset
 
class SystemStateChange
 
class InstrumentStateChange
 
class CrossRequest
 
class Ticker
 
class AllTradePrice
 
class PriceWithoutTurnover
 

Additional Inherited Members

- Protected Member Functions inherited from FieldSet
 FieldSet (const Message *, void *)
 
 FieldSet (const FieldSet &)
 
FieldSetoperator= (const FieldSet &)
 
- Protected Attributes inherited from FieldSet
void * impl_
 
const Messagecontainer_
 

Detailed Description

Encapsulates operations over a FIX Message.

Message supports 'unconstructed' state which can be treated as pointer in null state. However, in contrast to OnixS::FIX::Group and OnixS::FIX::GroupInstance classes it does NOT represent light-weight wrapper over internal structures. In fact, it holds all the data which is fully copied on assignment or copy construction and disposed at instance destruction.

FIX field related operations now available via OnixS::FIX::FieldSet class from which OnixS::FIX::Message class is now derived.

Constructor & Destructor Documentation

Message ( const Message other)

Initializes instance as deep copy of other one.

Parameters
otherMessage to be copied from.
~Message ( )

Disposes all internal data structures.

Warning
Once instance is destructed, all instances of OnixS::FIX::Group and OnixS::FIX::GroupInstance classes obtained from this instance must not be used any more.

Member Function Documentation

bool operator!= ( const Message ) const

Compares two messages.

Comparison is performed using 'tag=value' message presentations.

bool operator== ( const Message ) const

Compares two messages.

Comparison is performed using 'tag=value' message presentations.

FieldValueRef senderCompId ( ) const

Returns the assigned value used to identify firm sending message (SenderCompID (49) field value).

SequenceNumber seqNum ( ) const

Returns the message sequence number (the MsgSeqNum (tag=34) field value).

std::string toString ( char  delimiter = 0x1,
MessageStringingFlags  flags = MessageStringingFlag::IncludeFieldTagNumber 
) const
inline

Returns the string representation of the message using the given delimiter and additional control flags.

Parameters
delimiterDefines field delimiter to be used.
flagsAffect how message presentation looks like.
void toString ( std::string &  str,
char  delimiter = 0x1,
MessageStringingFlags  flags = MessageStringingFlag::IncludeFieldTagNumber 
) const

Appends string representation of the message using the given delimiter and additional control flags.

Parameters
strString to which presentation is appended.
delimiterDefines field delimiter to be used.
flagsAffect how message presentation looks like.
std::string toStringWithFieldNames ( ) const
inline

Returns the string representation of the message with field names using 0x1 delimiter.