#include <OnixS/FIXEngine/FIX/Message.h>
Classes | |
struct | MakeShallowCopy |
Public Member Functions | |
Message (size_t expectedMessageSize=DefaultExpectedMessageSize) | |
Message (const char *type, const Dictionary &dictionary, size_t expectedMessageSize=DefaultExpectedMessageSize) | |
Message (const Message &other) | |
virtual | ~Message () |
Dictionary | dictionary () const |
FieldValueRef | type () const |
SequenceNumber | seqNum () const |
void | seqNum (SequenceNumber value) |
FieldValueRef | senderCompId () const |
void | senderCompId (const std::string &) |
FieldValueRef | targetCompId () const |
void | targetCompId (const std::string &) |
void * | userData () const |
void | userData (void *data) |
bool | operator== (const Message &) const |
bool | operator!= (const Message &) const |
void | validate () const |
void | validate (MessageValidationFlags validationFlags) const |
bool | tryValidate (MessageValidationFlags validationFlags, std::string &errorDescription) const |
void | clear () |
void | toRaw (RawMessage &) const |
std::string | toString (char delimiter=0x1, MessageStringingFlags flags=MessageStringingFlag::IncludeFieldTagNumber) const |
void | toString (std::string &str, char delimiter=0x1, MessageStringingFlags flags=MessageStringingFlag::IncludeFieldTagNumber) const |
std::string | toXml () const |
void | toXml (std::string &str) const |
std::string | toJson () const |
void | toJson (std::string &str) const |
void | updateBodyLengthAndCheckSum () |
Message & | operator= (const Message &) |
void | copyFields (const Message &) |
![]() | |
bool | valid () const |
bool | contain (Tag tag) const |
FieldValueRef | get (Tag tag) const |
Char | getChar (Tag tag) const |
Int32 | getInt32 (Tag tag) const |
UInt32 | getUInt32 (Tag tag) const |
Int64 | getInt64 (Tag tag) const |
UInt64 | getUInt64 (Tag tag) const |
Double | getDouble (Tag tag) const |
Decimal | getDecimal (Tag tag) const |
Decimal | getDecimal (Tag tag, Int32 exponent) const |
StringRef | getStringRef (Tag tag) const |
Timestamp | getTimestamp (Tag tag) const |
Timestamp | getTimestamp (Tag tag, TimestampFormat::Enum) const |
TimeSpan | getTimeSpan (Tag tag) const |
Group | getGroup (Tag numberOfInstancesTag) const |
bool | hasFlag (Tag tag) const |
FieldSet & | set (Tag tag, Int32 value) |
FieldSet & | setV (Tag tag, Int32 value) |
FieldSet & | set (Tag tag, UInt32 value) |
FieldSet & | setV (Tag tag, UInt32 value) |
FieldSet & | set (Tag tag, Int64 value) |
FieldSet & | setV (Tag tag, Int64 value) |
FieldSet & | set (Tag tag, UInt64 value) |
FieldSet & | setV (Tag tag, UInt64 value) |
FieldSet & | set (Tag tag, Double value, size_t precision=17) |
FieldSet & | set (Tag tag, Double value, size_t precision, size_t length) |
FieldSet & | setV (Tag tag, Double value, size_t precision=17) |
FieldSet & | setV (Tag tag, Double value, size_t precision, size_t length) |
FieldSet & | set (Tag tag, const Decimal &value) |
FieldSet & | set (Tag tag, const Decimal &value, size_t length) |
FieldSet & | setV (Tag tag, const Decimal &value) |
FieldSet & | setV (Tag tag, const Decimal &value, size_t length) |
FieldSet & | set (Tag tag, char value) |
FieldSet & | set (Tag tag, const std::string &value) |
FieldSet & | set (Tag tag, const char *value) |
FieldSet & | set (Tag tag, const StringRef &value) |
FieldSet & | set (Tag tag, const Timestamp &value, TimestampFormat::Enum valueFormat=TimestampFormat::YYYYMMDDHHMMSSNsec) |
FieldSet & | setV (Tag tag, const Timestamp &value, TimestampFormat::Enum valueFormat=TimestampFormat::YYYYMMDDHHMMSSNsec) |
FieldSet & | set (Tag tag, const TimeSpan &value, TimeSpanFormat::Enum valueFormat=TimeSpanFormat::HHMMSSNsec) |
FieldSet & | setV (Tag tag, const TimeSpan &value, TimeSpanFormat::Enum valueFormat=TimeSpanFormat::HHMMSSNsec) |
Group | setGroup (Tag tag, size_t value) |
FieldSet & | setFlag (Tag tag, bool value) |
FieldSet & | set (Tag tag, const FieldValueRef &value) |
bool | erase (Tag tag) |
size_t | fields (Fields &fields) const |
ConstIterator | begin () const |
ConstIterator | end () const |
Static Public Member Functions | |
static void | parse (const char *rawMessage, size_t rawMessageSize, Message &message) |
static void | parse (const char *rawMessage, size_t rawMessageSize, MessageParsingFlags parsingFlags, Message &message) |
static void | parse (const char *rawMessage, size_t rawMessageSize, const Dictionary &dictionary, MessageParsingFlags parsingFlags, Message &message) |
static bool | parsePartial (const char *rawMessage, size_t rawMessageSize, Message &message) |
static bool | parsePartial (const char *rawMessage, size_t rawMessageSize, const Dictionary &dictionary, Message &message) |
Protected Member Functions | |
Message (const Message &other, MakeShallowCopy) | |
![]() | |
FieldSet () | |
FieldSet (const Message *, void *, AccessPolicies) | |
FieldSet (const FieldSet &) | |
~FieldSet () ONIXS_FIXENGINE_DEFAULT | |
FieldSet & | operator= (const FieldSet &) |
void | swap (FieldSet &) |
Friends | |
class | MessageWrapper |
class | MessageOperator |
Additional Inherited Members | |
![]() | |
typedef size_t | AccessPolicies |
![]() | |
void * | impl_ |
const Message * | container_ |
AccessPolicies | policies_ |
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.
|
explicit |
Message | ( | const char * | type, |
const Dictionary & | dictionary, | ||
size_t | expectedMessageSize = DefaultExpectedMessageSize |
||
) |
Constructs FIX message of given type which belongs to given dictionary of FIX protocol (messaging specification).
type | Defines type of message (MsgType field value). |
dictionary | FIX protocol dictionary to which message belongs to. |
expectedMessageSize | An expected size of the FIX message. The 'expectedMessageSize' parameter is used as a hint for the optimization of the manipulation (parsing, setting, etc.) of large FIX messages with a lot of repeating groups. |
Message
object, so try to increase the value only in case of a latency degradation of the large FIX messages manipulation.Initializes instance as deep copy of other one.
other | Message to be copied from. |
|
virtual |
Disposes all internal data structures.
|
protected |
Initializes instance as shallow copy of other one.
other | Message to be copied from. |
void clear | ( | ) |
Brings message to 'blank' state as it was just constructed.
void copyFields | ( | const Message & | ) |
Dictionary dictionary | ( | ) | const |
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.
|
static |
|
static |
De-serializes FIX message from its raw (tag=value) presentation.
rawMessage | buffer in which raw FIX message is stored. |
rawMessageSize | Size of buffer in which raw FIX message is stored. |
parsingFlags | flags which affect parsing behavior. |
message | parsed FIX message if parsing succeeds. |
std::exception | if parsing fails. |
|
static |
De-serializes FIX message from its raw (tag=value) presentation.
rawMessage | buffer in which raw FIX message is stored. |
rawMessageSize | Size of buffer in which raw FIX message is stored. |
dictionary | FIX dictionary to which message supposed to belong. |
parsingFlags | flags which affect parsing behavior. |
message | parsed FIX message if parsing succeeds. |
std::exception | if parsing fails. |
|
static |
De-serializes FIX message from its raw (tag=value) presentation which may be truncated.
rawMessage | buffer in which raw FIX message is stored. |
rawMessageSize | Size of buffer in which raw FIX message is stored. |
message | parsed FIX message if parsing succeeds. |
|
static |
De-serializes FIX message from its raw (tag=value) presentation which may be truncated.
rawMessage | buffer in which raw FIX message is stored. |
rawMessageSize | Size of buffer in which raw FIX message is stored. |
dictionary | FIX dictionary to which message supposed to belong. |
message | parsed FIX message if parsing succeeds. |
FieldValueRef senderCompId | ( | ) | const |
Returns the assigned value used to identify firm sending message (SenderCompID (49) field value).
void senderCompId | ( | const std::string & | ) |
Sets 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).
void seqNum | ( | SequenceNumber | value | ) |
Sets the message sequence number (the MsgSeqNum (tag=34) field value).
FieldValueRef targetCompId | ( | ) | const |
Returns the assigned value used to identify receiving firm (TargetCompID(56) field value).
void targetCompId | ( | const std::string & | ) |
Sets the assigned value used to identify receiving firm (TargetCompID(56) field value).
std::string toJson | ( | ) | const |
Returns the JSON representation of the message.
void toJson | ( | std::string & | str | ) | const |
Appends the JSON representation of the message.
str | String to which presentation is appended. |
void toRaw | ( | RawMessage & | ) | const |
Builds FIX-compliant 'tag=value' presentation of the message.
|
inline |
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.
str | String to which presentation is appended. |
delimiter | Defines field delimiter to be used. |
flags | Affect how message presentation looks like. |
std::string toXml | ( | ) | const |
Returns the XML representation of the message.
void toXml | ( | std::string & | str | ) | const |
Appends the XML representation of the message.
str | String to which presentation is appended. |
bool tryValidate | ( | MessageValidationFlags | validationFlags, |
std::string & | errorDescription | ||
) | const |
Tries to validate the message according to specified criteria.
Returns 'true' if the validation is successful, otherwise - 'false'.
validationFlags | Validation criteria. |
errorDescription | Contains the error description in case the validation fails. |
FieldValueRef type | ( | ) | const |
Returns the message type (MsgType(35) field value).
void updateBodyLengthAndCheckSum | ( | ) |
Calculates the message body length and checkSum and updates corresponding fields.
void* userData | ( | ) | const |
User data associated with the message.
void userData | ( | void * | data | ) |
Attaches user data to the message.
void validate | ( | ) | const |
Ensures message satisfies basic FIX Specification requirements.
std::exception | if validation fails. |
void validate | ( | MessageValidationFlags | validationFlags | ) | const |
Validates message according to specified criteria.
validationFlags | Specifies validation criteria. |
std::exception | if validation fails. |