Message Class Reference

FIX Message. More...

List of all members.

Public Types

enum  ValidationOptions { CHECK_LENGTH = 2, CHECK_CHECK_SUM = 4 }
 Validation options. More...
enum  FORMAT { TAG_NUMBER = 1, TAG_NAME = 2 }
 Format of the message string representation. More...

Public Member Functions

 Message (const std::string &nativeFixMessage)
 Constructs the FIX message object from the native (tag=value) representation.
 Message (const std::string &nativeFixMessage, int validationOptions)
 Constructs the FIX message object from the native (tag=value) representation.
 Message (const std::string &type, Version version)
 Constructor.
 Message (const char *type, Version version)
 Constructor.
 Message (const Message &msg)
 Copy Constructor.
 ~Message ()
 Destructor.
bool operator== (const Message &rh)
bool operator!= (const Message &rh)
void assemble ()
 Updates the BodyLength (9) and CheckSum (10) fields.
bool contain (int tag) const
 Returns 'true' if the message contains the field with the given tag, otherwise - 'false'.
const std::string & get (int tag) const
 Returns the field value as a string.
double getDouble (int tag) const
 Returns the field value as a floating-point number.
GroupgetGroup (int numberOfInstancesTag) const
 Returns the repeating group.
int getInteger (int tag) const
 Returns the field value as an integer.
const std::string & getSenderCompID () const
 Returns the assigned value used to identify firm sending message (SenderCompID (49) field value).
int getSeqNum () const
 Returns the message sequence number (the MsgSeqNum (tag=34) field value).
const std::string & getTargetCompID () const
 Returns the assigned value used to identify receiving firm (TargetCompID(56) field value).
const std::string & getType () const
 Returns the message type (MsgType(35) field value).
Version getVersion () const
 Returns the Financial Interface eXchange (FIX) protocol version.
bool hasFlag (int tag) const
 Returns true if the given flag is present and it equals to "Y", otherwise false.
bool remove (int tag)
 Removes the field.
bool set (int tag, int value)
 Sets the integer field value.
bool set (int tag, double value)
 Sets the double field value.
bool set (int tag, const std::string &value)
 Sets the string field value.
void setFlag (int tag, bool value)
 Sets the given flag to "Y" or "N".
GroupsetGroup (int numberOfInstancesTag, int numberOfIntances)
 Creates a new repeating group or changes the number of instances in the existing repeatign group.
void setSenderCompID (const std::string &value)
 Sets the assigned value used to identify firm sending message (SenderCompID (49) field value).
void setSeqNum (int value)
 Sets the message sequence number (the MsgSeqNum (tag=34) 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 (int format, char delimiter= ' ') const
 Returns the <tag>=<value> string representation of the message using the given format and delimiter.
void validate () const
 Validates the message.

Friends

class Session
struct Session::Impl
class FAST_1_0::Context
class FAST_1_1::Encoder
class FAST_1_1::Decoder
FF_API std::ostream & operator<< (std::ostream &os, const Message &msg)


Detailed Description

FIX Message.

Definition at line 29 of file Message.h.


Member Enumeration Documentation

enum ValidationOptions

Validation options.

Enumerator:
CHECK_LENGTH 
CHECK_CHECK_SUM 

Definition at line 32 of file Message.h.

enum FORMAT

Format of the message string representation.

Enumerator:
TAG_NUMBER 
TAG_NAME 

Definition at line 159 of file Message.h.


Constructor & Destructor Documentation

Message ( const std::string &  nativeFixMessage  ) 

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

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

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

Parameters:
nativeFixMessage The native (raw) FIX message in the 'tag=value' format.
validationOptions Several ValidationOptions values can be joined using '|'.

Message ( const std::string &  type,
Version  version 
)

Constructor.

Message ( const char *  type,
Version  version 
)

Constructor.

Message ( const Message msg  ) 

Copy Constructor.

~Message (  ) 

Destructor.


Member Function Documentation

bool operator== ( const Message rh  ) 

bool operator!= ( const Message rh  ) 

void assemble (  ) 

Updates the BodyLength (9) and CheckSum (10) fields.

bool contain ( int  tag  )  const

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

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

Returns the field value as a string.

double getDouble ( int  tag  )  const

Returns the field value as a floating-point number.

Warning:
Return 0 if the field value is absent.

Group* getGroup ( int  numberOfInstancesTag  )  const

Returns the repeating group.

Parameters:
numberOfInstancesTag Tag 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 getInteger ( int  tag  )  const

Returns the field value as an integer.

Warning:
Return 0 if the field value is absent.

const std::string& getSenderCompID (  )  const

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

int getSeqNum (  )  const

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

const std::string& getTargetCompID (  )  const

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

const std::string& getType (  )  const

Returns the message type (MsgType(35) field value).

Version getVersion (  )  const

Returns the Financial Interface eXchange (FIX) protocol version.

bool hasFlag ( int  tag  )  const

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

bool remove ( int  tag  ) 

Removes the field.

bool set ( int  tag,
int  value 
)

Sets the integer field value.

bool set ( int  tag,
double  value 
)

Sets the double field value.

bool set ( int  tag,
const std::string &  value 
)

Sets the string field value.

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 repeatign group.

Parameters:
numberOfInstancesTag Tag number of the field that defines the number of instances in this repeating group (the NoXXX field).
numberOfIntances Number 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 setSeqNum ( int  value  ) 

Sets the message sequence number (the MsgSeqNum (tag=34) 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 ( int  format,
char  delimiter = ' ' 
) const

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

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

void validate (  )  const

Validates the message.


Friends And Related Function Documentation

friend class Session [friend]

Definition at line 189 of file Message.h.

friend struct Session::Impl [friend]

Definition at line 190 of file Message.h.

friend class FAST_1_0::Context [friend]

Definition at line 191 of file Message.h.

friend class FAST_1_1::Encoder [friend]

Definition at line 192 of file Message.h.

friend class FAST_1_1::Decoder [friend]

Definition at line 193 of file Message.h.

FF_API std::ostream& operator<< ( std::ostream &  os,
const Message msg 
) [friend]


The documentation for this class was generated from the following file:
Generated on Sun Jun 8 14:08:38 2008 for FIXForge C++ FIX Engine by  doxygen 1.5.2