36template <
template<
class>
class Block,
class FieldAccessor>
43 const Block<FieldAccessor>& block()
const
46 return *
static_cast<const Block<FieldAccessor>*
>(
this);
51 template <
class FieldValue>
55 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
57 return FieldAccessor::get(FieldValue(),
advanceByBytes(block().binary(), offset));
61 template <
class FieldValue>
65 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
67 return *
static_cast <const FieldValue*
>(
advanceByBytes(block().binary(), offset));
74 template <
class Enumeration>
75 typename Enumeration::Enum
enumeration(BlockSize offset)
const
78 typedef typename Enumeration::Base Base;
80 typedef typename Enumeration::Enum Enum;
89 template <BlockSize Size>
93 typedef Char Str[Size];
95 assert(block().binarySize() >= (offset + Size));
103template <
class Accessor>
125 ONIXS_ESPEED_ITCH_CONSTEXPR
160#if defined(ONIXS_ESPEED_ITCH_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_ESPEED_ITCH_COMPILER_CXX_RVALUE_REFERENCES
164 : data_(std::move(other.data_))
165 , size_(std::move(other.size_))
177 data_ = std::move(other.data_);
178 size_ = std::move(other.size_);
ONIXS_ESPEED_ITCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
#define ONIXS_ESPEED_ITCH_NAMESPACE_BEGIN
#define ONIXS_ESPEED_ITCH_NAMESPACE_END
#define ONIXS_ESPEED_ITCH_NOTHROW
ONIXS_ESPEED_ITCH_NAMESPACE_BEGIN typedef UInt16 MessageSize
Aliases message length type.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
ONIXS_ESPEED_ITCH_NAMESPACE_BEGIN typedef char Char
Character type alias.
const FieldValue & ordinaryRef(BlockSize offset) const ONIXS_ESPEED_ITCH_NOTHROW
Returns value of a field by its offset.
StrRef fixedStr(BlockSize offset) const ONIXS_ESPEED_ITCH_NOTHROW
FieldValue ordinary(BlockSize offset) const ONIXS_ESPEED_ITCH_NOTHROW
Returns value of a field by its offset.
Enumeration::Enum enumeration(BlockSize offset) const ONIXS_ESPEED_ITCH_NOTHROW
Encapsulates services for manipulating encoded messages.
MessageSize BinarySize
Length of message binary data.
BinaryMessage(const void *data, MessageSize size) ONIXS_ESPEED_ITCH_NOTHROW
Initializes instance over given memory block.
ONIXS_ESPEED_ITCH_CONSTEXPR BinaryMessage(const BinaryMessage &other) ONIXS_ESPEED_ITCH_NOTHROW
Initializes instance as copy of the other one.
const void * binary() const ONIXS_ESPEED_ITCH_NOTHROW
Message content.
BinaryMessage & operator=(const BinaryMessage &other) ONIXS_ESPEED_ITCH_NOTHROW
Re-initializes instance as a copy of the other one.
MessageSize binarySize() const ONIXS_ESPEED_ITCH_NOTHROW
Size of message.
Provides efficient way of accessing text-based FIX field values.