28 ONIXS_SGXTITAN_ITCH_NAMESPACE_BEGIN
36 template <
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;
82 return static_cast<Enum
>(ordinaryRef<Base>(offset));
89 template <BlockSize Size>
93 typedef Char Str[Size];
95 assert(block().binarySize() >= (offset + Size));
98 StrRef(ordinaryRef<Str>(offset), strnlen(ordinaryRef<Str>(offset), Size));
103 template <
class Accessor>
125 ONIXS_SGXTITAN_ITCH_CONSTEXPR
160 #if defined(ONIXS_SGXTITAN_ITCH_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_SGXTITAN_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_);
186 ONIXS_SGXTITAN_ITCH_API
190 ONIXS_SGXTITAN_ITCH_NAMESPACE_END
char Char
Character type alias.
const void * binary() const
Message content.
MessageSize BinarySize
Length of message binary data.
#define ONIXS_SGXTITAN_ITCH_NOTHROW
MessageSize binarySize() const
Size of message.
UInt16 MessageSize
Aliases message length type.
StrRef fixedStr(BlockSize offset) const
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
ONIXS_SGXTITAN_ITCH_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
const FieldValue & ordinaryRef(BlockSize offset) const
Returns value of a field by its offset.
FieldValue ordinary(BlockSize offset) const
Returns value of a field by its offset.
BinaryMessage(const void *data, MessageSize size)
Initializes instance over given memory block.
ONIXS_SGXTITAN_ITCH_CONSTEXPR BinaryMessage(const BinaryMessage &other)
Initializes instance as copy of the other one.
Encapsulates services for manipulating encoded messages.
Enumeration::Enum enumeration(BlockSize offset) const
Provides efficient way of accessing text-based FIX field values.