OnixS C++ FIX Engine 2.79.1.0
Message Class Reference

FIX Message.

List of all members.

Public Types

enum  ValidationOption { CHECK_LENGTH = MessageValidationFlags::VerifyBodyLength, CHECK_CHECK_SUM = MessageValidationFlags::VerifyCheckSum }
enum  FORMAT { TAG_NUMBER = MessageStringingFlags::IncludeTagNumber, TAG_NAME = MessageStringingFlags::IncludeTagName }

Public Member Functions

 Message (const std::string &nativeFixMessage)
 Message (const std::string &nativeFixMessage, MessageValidationOptions validationOptions)
 Message (const std::string &nativeFixMessage, const Dialect &dialect, MessageValidationOptions validationOptions)
 Message (const char *type, Version version, MessageStructurePolicy policy=MessageStructurePolicies::SerializationOptimized)
 Message (const char *type, const Dialect &dialect, MessageStructurePolicy policy=MessageStructurePolicies::SerializationOptimized)
 Message (const std::string &type, Version version, MessageStructurePolicy policy=MessageStructurePolicies::SerializationOptimized)
 Message (const std::string &type, const Dialect &dialect, MessageStructurePolicy policy=MessageStructurePolicies::SerializationOptimized)
 Message (const Message &source)
Messageoperator= (const Message &source)
 ~Message ()
const std::string & getType () const
Version getVersion () const
const Dialectdialect () const
const std::string & getSenderCompID () const
void setSenderCompID (const std::string &value)
int getSeqNum () const
void setSeqNum (int value)
const std::string & getTargetCompID () const
void setTargetCompID (const std::string &value)
bool contain (int tag) const
const std::string & get (int tag) const
int getInteger (int tag) const
int getInt32 (int tag) const
unsigned int getUInt32 (int tag) const
long long getInt64 (int tag) const
unsigned long long getUInt64 (int tag) const
double getDouble (int tag) const
GroupgetGroup (int numberOfInstancesTag) const
bool hasFlag (int tag) const
bool set (int tag, char value)
bool set (int tag, int value)
bool set (int tag, unsigned int value)
bool set (int tag, long long value)
bool set (int tag, unsigned long long value)
bool set (int tag, double value)
bool set (int tag, double value, size_t precision)
bool set (int tag, const std::string &value)
bool set (int tag, const char *value)
void setFlag (int tag, bool value)
GroupsetGroup (int numberOfInstancesTag, int numberOfIntances)
bool remove (int tag)
const std::string & toString () const
const std::string & toString (char delimiter) const
const std::string & toString (MessageStringingOptions options, char delimiter= ' ') const
void validate () const
void updateCheckSum ()
bool operator== (const Message &rh) const
bool operator!= (const Message &rh) const

Friends

class MessageProxy
ONIXS_FIXENGINE_API std::ostream & operator<< (std::ostream &os, const Message &message)

Member Enumeration Documentation

enum FORMAT

Format of the message string representation.

Warning:
Deprecated, use MessageValidationOptions instead.

Validation options.

Warning:
Deprecated, use MessageValidationOptions instead.

Constructor & Destructor Documentation

Message ( const std::string &  nativeFixMessage,
MessageValidationOptions  validationOptions 
)

Constructs the FIX message object from the native (tag=value) representation.

Parameters:
nativeFixMessageThe native (raw) FIX message in the 'tag=value' format.
validationOptionsSeveral ValidationOption values can be joined using '|'.
Message ( const std::string &  nativeFixMessage,
const Dialect dialect,
MessageValidationOptions  validationOptions 
)

Constructs the FIX message object from the native (tag=value) representation.

Parameters:
nativeFixMessageThe native (raw) FIX message in the 'tag=value' format.
dialectDialect of the FIX protocol to which message belongs to.
validationOptionsSeveral ValidationOption values can be joined using '|'.
Message ( const char *  type,
Version  version,
MessageStructurePolicy  policy = MessageStructurePolicies::SerializationOptimized 
)

Constructs blank FIX message of given type which belongs to given version of FIX protocol (messaging specification).

Parameters:
typeDefines type of message to be constructed (MsgType value).
versionVersion of the FIX protocol to which message belongs to.
policyDefines structure policy for the message.
Message ( const char *  type,
const Dialect dialect,
MessageStructurePolicy  policy = MessageStructurePolicies::SerializationOptimized 
)

Constructs blank FIX message of given type which belongs to given dialect of FIX protocol (messaging specification).

Parameters:
typeDefines type of message to be constructed (MsgType value).
dialectDialect of the FIX protocol to which message belongs to.
policyDefines structure policy for the message.
Message ( const std::string &  type,
Version  version,
MessageStructurePolicy  policy = MessageStructurePolicies::SerializationOptimized 
)

Constructs blank FIX message of given type which belongs to given version of FIX protocol (messaging specification).

Parameters:
typeDefines type of message to be constructed (MsgType value).
versionVersion of the FIX protocol to which message belongs to.
policyDefines structure policy for the message.
Message ( const std::string &  type,
const Dialect dialect,
MessageStructurePolicy  policy = MessageStructurePolicies::SerializationOptimized 
)

Constructs blank FIX message of given type which belongs to given dialect of FIX protocol (messaging specification).

Parameters:
typeDefines type of message to be constructed (MsgType value).
dialectDialect of the FIX protocol to which message belongs to.
policyDefines structure policy for the message.
Message ( const Message source)

Copy Constructor.

Parameters:
sourceSource Message object.

Member Function Documentation

bool contain ( int  tag) const

Returns 'true' if the message contains the field with the given tag, otherwise - 'false'.

const Dialect& dialect ( ) const

Instance of FIX dialect or standard FIX messages dictionary to which the message belongs to.

const std::string& get ( int  tag) const

Returns the field value as a string.

Warning:
This method returns the constant reference to the internal buffer, so the previously returned value become invalid after the subsequent call to this method.
double getDouble ( int  tag) const

Returns the field value as a floating-point number.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
Group* getGroup ( int  numberOfInstancesTag) const

Returns the repeating group.

Parameters:
numberOfInstancesTagTag number of the field that defines the number of instances in this repeating group (the NoXXX field).
Warning:
To avoid memory leaks call Group::release() when the Group object is not used anymore.
int getInt32 ( int  tag) const

Returns field value as an int value.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
long long getInt64 ( int  tag) const

Returns field value as an 'long long' value.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
int getInteger ( int  tag) const

Returns the field value as an integer.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
Warning:
Deprecated, use getInt32 or other appropriate member.
const std::string& getSenderCompID ( ) const

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

const std::string& getTargetCompID ( ) const

Returns the assigned value used to identify receiving firm (TargetCompID(56) field value).

unsigned int getUInt32 ( int  tag) const

Returns field value as an 'unsigned int' value.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
unsigned long long getUInt64 ( int  tag) const

Returns field value as an 'unsigned long long' value.

Exceptions:
std::exceptionif conversion is impossible or field is absent.
bool hasFlag ( int  tag) const

Returns true if the given flag is present and it equals to "Y", otherwise false.

Message& operator= ( const Message source)

Assignment operator.

Parameters:
sourceSource Message object.
bool set ( int  tag,
unsigned int  value 
)

otherwise "false" (the field was inserted into the message).

Sets the unsigned integer field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
const char *  value 
)

otherwise "false" (the field was inserted into the message).

Sets the string field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
double  value,
size_t  precision 
)

otherwise "false" (the field was inserted into the message).

Sets the double field value.

Parameters:
tagTag number.
valueField value.
precisionprecision of a floating value.
Returns:
"true" if the value had value before,
bool set ( int  tag,
char  value 
)

otherwise "false" (the field was inserted into the message).

Sets the character field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
int  value 
)

otherwise "false" (the field was inserted into the message).

Sets the integer field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
long long  value 
)

otherwise "false" (the field was inserted into the message).

Sets the 64-bit integer field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
unsigned long long  value 
)

otherwise "false" (the field was inserted into the message).

Sets the 64-bit unsigned integer field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
double  value 
)

otherwise "false" (the field was inserted into the message).

Sets the double field value.

Returns:
"true" if the value had value before,
bool set ( int  tag,
const std::string &  value 
)

otherwise "false" (the field was inserted into the message).

Sets the string field value.

Returns:
"true" if the value had value before,
void setFlag ( int  tag,
bool  value 
)

Sets the given flag to "Y" or "N".

Returns:
"true" if the flag had value before, otherwise "false" (the flag was inserted into the message).
Group* setGroup ( int  numberOfInstancesTag,
int  numberOfIntances 
)

Creates a new repeating group or changes the number of instances in the existing repeating group.

Warning:
To avoid memory leaks call Group::release() when the created Group object is not used anymore.
Parameters:
numberOfInstancesTagTag number of the field that defines the number of instances in this repeating group (the NoXXX field).
numberOfIntancesNumber of instances in the repeating group.
void setSenderCompID ( const std::string &  value)

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

void setTargetCompID ( const std::string &  value)

Sets the assigned value used to identify receiving firm (TargetCompID(56) field value).

const std::string& toString ( ) const

Returns the <tag>=<value> string representation of the message using the standard FIX delimiter ('0x01').

const std::string& toString ( char  delimiter) const

Returns the <tag>=<value> string representation of the message using the given delimiter.

const std::string& toString ( MessageStringingOptions  options,
char  delimiter = ' ' 
) const

Returns the <tag>=<value> string representation of the message using the given format and delimiter.

Parameters:
optionsFormat of the string representation, several FORMAT values could be joined using logical 'or' operator.
delimiterFields delimiter.
See also:
FORMAT