73 : tag_(fieldTag), value_(fieldValue.data()), size_(fieldValue.size()) {}
123 FlatMessage(
const char * rawMessage,
size_t rawMessageSize,
bool useZeroCopyBuffer =
true);
129 const char * msgType,
130 const char * senderCompId,
131 const char * targetCompId,
132 const char * rawMessageWithoutHeaderTrailer,
133 size_t rawMessageWithoutHeaderTrailerSize,
134 bool useZeroCopyBuffer =
true);
142#ifdef ONIXS_FIXENGINE_CXX11
422 void reset(
const char * rawMessage,
size_t rawMessageSize);
447#ifdef ONIXS_FIXENGINE_CXX11
471 return currentField_;
475 return ¤tField_;
501 FlatMessage(
const OnixS::FIX::Core::Messaging::Extras::FlatMessage & other);
503 OnixS::FIX::Core::Messaging::Extras::FlatMessage * impl_;
#define ONIXS_FIXENGINE_API_DECL(typeKind, typeName)
#define ONIXS_FIXENGINE_API
#define ONIXS_FIXENGINE_NULLPTR
#define ONIXS_FIXENGINE_NOTHROW
The Decimal type for a better precision.
Implements a concept of a read-only reference to a FIX field value.
Key to a serialized field - represents another way of accessing fields in an editable serialized mess...
Represents a temporary reference to a field in an editable serialized message.
Field primary attributes (a tag and a reference to a value).
Tag tag() const
Gets the field tag.
FlatField()
Initializes the field which refers to nothing.
FlatField(Tag fieldTag, const StringRef &fieldValue)
Initializes all members.
StringRef value() const
Gets the field value reference.
Encapsulates operations over the FIX Repeating Group.
The constant iterator to iterate over all fields in the given FlatMessage instance.
const FlatField & operator*() const
std::forward_iterator_tag iterator_category
const FlatField * operator->() const
std::ptrdiff_t difference_type
ConstIterator(const FlatMessage *, Tag)
Initializes an iterator by a first field from which you need to iterate.
Provides an access to FIX fields from a flat (tag=value) message.
FlatMessage & insert(Tag, Int64, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & insert(Tag, const Timestamp &, TimestampFormat::Enum, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & insert(Tag, Int32, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & set(FlatFieldRef &, UInt64)
Updates the field value.
StringRef operator[](FlatFieldKey) const
Provides an access to a field value by the given field key.
FlatMessage(OnixS::FIX::ProtocolVersion::Enum protocolVersion, const char *msgType, const char *senderCompId, const char *targetCompId, const char *rawMessageWithoutHeaderTrailer, size_t rawMessageWithoutHeaderTrailerSize, bool useZeroCopyBuffer=true)
Constructs an instance from the tag=value form without session-level fields.
FlatFieldRef find(Tag, const FlatFieldRef &) const
Looks for a field with assumption the field is located after the given field using its tag number.
FlatMessage & insert(Tag, UInt64, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
std::string toString() const
Returns a string that represents the flat message.
FlatMessage & remove(Tag)
Removes the field value.
FlatMessage & add(Tag, Char)
Adds the tag/value pair to the end of the message.
FlatMessage & add(Tag, UInt64)
Adds the tag/value pair to the end of the message.
FlatMessage & add(Tag, const Decimal &)
Adds the tag/value pair to the end of the message.
size_t size() const
The size of the flat content.
FlatFieldRef find(Tag) const
Looks for a field using the given tag number.
FlatMessage(const char *rawMessage, size_t rawMessageSize, bool useZeroCopyBuffer=true)
Constructs an instance from the tag=value form.
FlatMessage & add(Tag, Int64)
Adds the tag/value pair to the end of the message.
FlatMessage & add(Tag, const TimeSpan &, TimeSpanFormat::Enum)
Adds the tag/value pair to the end of the message.
FlatMessage & set(FlatFieldKey, UInt64)
Updates the field value.
void reset(const char *rawMessage, size_t rawMessageSize)
Resets the instance to the new tag=value form.
bool valid() const
Indicates whether an instance refers to a valid set of fields.
FlatMessage & insert(Tag, const TimeSpan &, TimeSpanFormat::Enum, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & set(FlatFieldRef &, const Decimal &)
Updates the field value.
FlatMessage & set(FlatFieldKey, UInt32)
Updates the field value.
FlatFieldKey allocateKey(const FlatFieldRef &)
Allocates a key to the requested field for the further access.
FlatMessage(OnixS::FIX::ProtocolVersion::Enum protocolVersion, const char *msgType)
Constructs an instance with empty required message header fields.
FlatMessage & add(Tag, const StringRef &)
Adds the tag/value pair to the end of the message.
FlatMessage & set(FlatFieldKey, const Decimal &)
Updates the field value.
FlatMessage & add(Tag, UInt32)
Adds the tag/value pair to the end of the message.
FlatMessage & set(FlatFieldRef &, const FieldValueRef &)
Updates the field value.
StringRef operator[](const FlatFieldRef &) const
Provides an access to a field value by the given temporary reference.
FlatMessage & insert(Tag, const Decimal &, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
ConstIterator end() const
Returns the constant iterator to the field after the last one in the FlatMessage instance.
void * userData() const
A user data associated with the message.
void adjust()
Updates BodyLength and CheckSum fields.
void userData(void *data)
Attaches a user data to the message.
FlatMessage & set(FlatFieldKey, const StringRef &)
Updates the field value.
FlatMessage & insert(Tag, UInt32, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & set(FlatFieldKey, const TimeSpan &, TimeSpanFormat::Enum)
Updates the field value.
friend class MessageOperator
void swap(FlatMessage &other) ONIXS_FIXENGINE_NOTHROW
Swaps the content with another instance.
FlatMessage & set(FlatFieldKey, const FieldValueRef &)
Updates the field value.
~FlatMessage()
Utilizes internal resources.
FlatMessage & set(FlatFieldKey, Int64)
Updates the field value.
FlatMessage & set(FlatFieldRef &, Char)
Updates the field value.
FlatMessage & set(FlatFieldKey, const Timestamp &, TimestampFormat::Enum)
Updates the field value.
FlatMessage & set(FlatFieldKey, Char)
Updates the field value.
FlatFieldKey allocateKey(Tag)
Finds and allocates a key to the requested field for the further access.
FlatMessage & insert(Tag, Char, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatFieldRef getFlatFieldRef(const StringRef &value) const
Converts the StringRef value of the given FlatMessage to the FlatFieldRef object.
FlatGroup getGroup(const FlatFieldRef &numberOfInstancesRef) const
Returns the reference to a repeating group - if exists.
FlatMessage(const FlatMessage &other)
Initializes as a copy of the given instance.
FlatMessage & set(FlatFieldRef &, Int64)
Updates the field value.
FlatMessage()
Constructs the blank instance.
FlatMessage & add(Tag, Int32)
Adds the tag/value pair to the end of the message.
FlatMessage & set(FlatFieldRef &, const TimeSpan &, TimeSpanFormat::Enum)
Updates the field value.
FlatMessage & add(Tag, const Timestamp &, TimestampFormat::Enum)
Adds the tag/value pair to the end of the message.
FlatMessage & set(FlatFieldRef &, const StringRef &)
Updates the field value.
friend class FlatMessageWrapper
void reset()
Resets the instance to the blank state.
FlatMessage(const OnixS::FIX::Message &message, bool useZeroCopyBuffer=true)
Constructs an instance from the given Message object.
ConstIterator begin() const
Returns the constant iterator to the first field in the FlatMessage instance.
FlatMessage & set(FlatFieldRef &, Int32)
Updates the field value.
FlatMessage & set(FlatFieldKey, Int32)
Updates the field value.
FlatMessage & insert(Tag, const StringRef &, Tag, InsertMode::Enum=InsertMode::Before)
Inserts the tag/value pair to the message before or after the position field.
FlatMessage & set(FlatFieldRef &, const Timestamp &, TimestampFormat::Enum)
Updates the field value.
const char * chars() const
Returns the content of the flat message.
FlatMessage & set(FlatFieldRef &, UInt32)
Updates the field value.
ProtocolVersion::Enum version() const
Encapsulates operations over a FIX Message.
Provides an efficient way of accessing text-based FIX field values.
The time span related functionality.
The timestamps related functionality.
FlatMessage SerializedMessage
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const Group &group)
Stream output.
unsigned long long UInt64
unsigned Tag
Alias for tag numbers.
The insert mode of FlatMessage::insert() methods.
@ After
The new field will be inserted after the position tag.
@ Before
The new field will be inserted before the position tag.