FIX Message.
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) | |
Message & | operator= (const Message &source) |
~Message () | |
const std::string & | getType () const |
Version | getVersion () const |
const Dialect & | dialect () 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 |
Group * | getGroup (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) |
Group * | setGroup (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) |
enum FORMAT |
Format of the message string representation.
enum ValidationOption |
Validation options.
Message | ( | const std::string & | nativeFixMessage, |
MessageValidationOptions | validationOptions | ||
) |
Constructs the FIX message object from the native (tag=value) representation.
nativeFixMessage | The native (raw) FIX message in the 'tag=value' format. |
validationOptions | Several 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.
nativeFixMessage | The native (raw) FIX message in the 'tag=value' format. |
dialect | Dialect of the FIX protocol to which message belongs to. |
validationOptions | Several 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).
type | Defines type of message to be constructed (MsgType value). |
version | Version of the FIX protocol to which message belongs to. |
policy | Defines 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).
type | Defines type of message to be constructed (MsgType value). |
dialect | Dialect of the FIX protocol to which message belongs to. |
policy | Defines 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).
type | Defines type of message to be constructed (MsgType value). |
version | Version of the FIX protocol to which message belongs to. |
policy | Defines 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).
type | Defines type of message to be constructed (MsgType value). |
dialect | Dialect of the FIX protocol to which message belongs to. |
policy | Defines structure policy for the message. |
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.
double getDouble | ( | int | tag | ) | const |
Returns the field value as a floating-point number.
std::exception | if conversion is impossible or field is absent. |
Group* getGroup | ( | int | numberOfInstancesTag | ) | const |
Returns the repeating group.
numberOfInstancesTag | Tag number of the field that defines the number of instances in this repeating group (the NoXXX field). |
int getInt32 | ( | int | tag | ) | const |
Returns field value as an int value.
std::exception | if conversion is impossible or field is absent. |
long long getInt64 | ( | int | tag | ) | const |
Returns field value as an 'long long' value.
std::exception | if conversion is impossible or field is absent. |
int getInteger | ( | int | tag | ) | const |
Returns the field value as an integer.
std::exception | if conversion is impossible or field is absent. |
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.
std::exception | if conversion is impossible or field is absent. |
unsigned long long getUInt64 | ( | int | tag | ) | const |
Returns field value as an 'unsigned long long' value.
std::exception | if 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.
Assignment operator.
source | Source Message object. |
bool set | ( | int | tag, |
unsigned int | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the unsigned integer field value.
bool set | ( | int | tag, |
const char * | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the string field value.
bool set | ( | int | tag, |
double | value, | ||
size_t | precision | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the double field value.
tag | Tag number. |
value | Field value. |
precision | precision of a floating value. |
bool set | ( | int | tag, |
char | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the character field value.
bool set | ( | int | tag, |
int | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the integer field value.
bool set | ( | int | tag, |
long long | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the 64-bit integer field value.
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.
bool set | ( | int | tag, |
double | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the double field value.
bool set | ( | int | tag, |
const std::string & | value | ||
) |
otherwise "false" (the field was inserted into the message).
Sets the string field value.
void setFlag | ( | int | tag, |
bool | value | ||
) |
Sets the given flag to "Y" or "N".
Group* setGroup | ( | int | numberOfInstancesTag, |
int | numberOfIntances | ||
) |
Creates a new repeating group or changes the number of instances in the existing repeating group.
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 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.
options | Format of the string representation, several FORMAT values could be joined using logical 'or' operator. |
delimiter | Fields delimiter. |