65 explicit Message(
size_t expectedMessageSize = DefaultExpectedMessageSize);
89#ifdef ONIXS_FIXENGINE_CXX11
198 char delimiter = 0x1,
211 char delimiter = 0x1,
220 toXml(
const std::string & indent =
" ",
const std::string & endOfLineDelimiter =
"\n")
const;
228 toXml(std::string & str,
const std::string & indent =
" ",
const std::string & endOfLineDelimiter =
"\n")
const;
235 toJson(
const std::string & indent =
" ",
const std::string & endOfLineDelimiter =
"\n")
const;
243 toJson(std::string & str,
const std::string & indent =
" ",
const std::string & endOfLineDelimiter =
"\n")
const;
254#ifdef ONIXS_FIXENGINE_CXX11
276 const char * rawMessage,
277 size_t rawMessageSize,
291 const char * rawMessage,
292 size_t rawMessageSize,
308 const char * rawMessage,
309 size_t rawMessageSize,
325 const char * rawMessage,
326 size_t rawMessageSize,
341 const char * rawMessage,
342 size_t rawMessageSize,
362 virtual void userDataImpl(
void * data);
364 unsigned char impl_[6 *
sizeof(size_t)];
365 unsigned char allocator_[4 *
sizeof(size_t)];
367 static const size_t DefaultExpectedMessageSize = 10240;
369 void construct(
size_t expectedMessageSize = DefaultExpectedMessageSize);
#define ONIXS_FIXENGINE_API
#define ONIXS_FIXENGINE_NOTHROW
Identifies the FIX messages dictionary.
Implements a concept of a read-only reference to a FIX field value.
Encapsulates operations over a FIX Message.
FieldValueRef type() const
Returns the message type (MsgType(35) field value).
static void parse(const char *rawMessage, size_t rawMessageSize, const Dictionary &dictionary, MessageParsingFlags parsingFlags, Message &message)
De-serializes the FIX message from its raw (tag=value) presentation.
void toString(std::string &str, char delimiter=0x1, MessageStringingFlags flags=MessageStringingFlag::IncludeFieldTagNumber) const
Appends the string representation of the message using the given delimiter and additional control fla...
FieldValueRef targetCompId() const
Returns the assigned value used to identify the receiving firm (TargetCompID(56) 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).
void toRaw(RawMessage &) const
Builds the FIX-compliant 'tag=value' presentation of the message.
bool tryValidate(MessageValidationFlags validationFlags, std::string &errorDescription) const
Tries to validate the message according to specified criteria.
static bool parsePartial(const char *rawMessage, size_t rawMessageSize, Message &message)
De-serializes the FIX message from its raw (tag=value) presentation which may be truncated.
Dictionary dictionary() const
An instance of the FIX dictionary or standard FIX messages dictionary to which the message belongs to...
static bool parsePartial(const char *rawMessage, size_t rawMessageSize, const Dictionary &dictionary, Message &message)
De-serializes the FIX message from its raw (tag=value) presentation which may be truncated.
static void parse(const char *rawMessage, size_t rawMessageSize, Message &message)
De-serializes the FIX message from its raw (tag=value) presentation.
void senderCompId(const std::string &)
Sets the assigned value used to identify the firm sending message (SenderCompID (49) field value).
void toJson(std::string &str, const std::string &indent=" ", const std::string &endOfLineDelimiter="\n") const
Appends the JSON representation of the message.
Message(size_t expectedMessageSize=DefaultExpectedMessageSize)
Initializes a message in the unconstructed state.
void * userData() const
A user data associated with the message.
void userData(void *data)
Attaches a user data to the message.
std::string toJson(const std::string &indent=" ", const std::string &endOfLineDelimiter="\n") const
Returns the JSON representation of the message.
friend class MessageOperator
FieldValueRef senderCompId() const
Returns the assigned value used to identify the firm sending message (SenderCompID (49) field value).
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 fla...
friend class MessageWrapper
Message(const Message &other, MakeShallowCopy)
Initializes an instance as a shallow copy of other one.
void swap(Message &other) ONIXS_FIXENGINE_NOTHROW
Swaps the content with another instance.
void updateBodyLengthAndCheckSum()
Calculates the message body length and checkSum and updates corresponding fields.
Message(const char *type, const Dictionary &dictionary, size_t expectedMessageSize=DefaultExpectedMessageSize)
Constructs a FIX message of the given type which belongs to the given dictionary of the FIX protocol ...
static void parse(const char *rawMessage, size_t rawMessageSize, MessageParsingFlags parsingFlags, Message &message)
De-serializes the FIX message from its raw (tag=value) presentation.
void validate() const
Ensures the message satisfies basic FIX Specification requirements.
void validate(MessageValidationFlags validationFlags) const
Validates the message according to specified criteria.
std::string toXml(const std::string &indent=" ", const std::string &endOfLineDelimiter="\n") const
Returns the XML representation of the message.
void targetCompId(const std::string &)
Sets the assigned value used to identify the receiving firm (TargetCompID(56) field value).
Message(const Message &other)
Initializes an instance as a deep copy of other one.
void clear()
Brings the message to the 'blank' state as it was just constructed.
void toXml(std::string &str, const std::string &indent=" ", const std::string &endOfLineDelimiter="\n") const
Appends the XML representation of the message.
virtual ~Message()
Disposes all internal data structures.
void copyFields(const Message &)
The helper class to represent a raw FIX message.
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const Group &group)
Stream output.
bool operator==(const FieldValueRef &ref, const std::string &str)
unsigned MessageParsingFlags
The collection of message parsing flags.
unsigned MessageValidationFlags
The collection of message validation flags.
unsigned int SequenceNumber
Alias for the sequence number.
bool operator!=(const FieldValueRef &ref, const std::string &str)
unsigned MessageStringingFlags
The collection of message stringing flags.
@ IncludeFieldTagNumber
Field tag numbers are included during the serialization.