25#include <OnixS/HKEX/MarketData/Omdc/Export.h>
40 template <
class FieldValue>
53 template <
class Block,
class BlockSize>
58 const Block& block()
const
61 return *
static_cast<const Block*
>(
this);
66 template <
class SubMessage>
67 const SubMessage
submessage(BlockSize offset, BlockSize size)
const
70 assert(block().binarySize() >= (offset + size));
77 template <
class FieldValue>
81 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
87 template <
class FieldValue>
91 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
94 *
static_cast <const FieldValue*
>(
advanceByBytes(block().binary(), offset));
101 template <
class Enumeration>
105 typedef typename Enumeration::Base Base;
107 typedef typename Enumeration::Enum Enum;
116 template <BlockSize Size>
120 typedef Char Str[Size];
124 return StrRef(str, strnlen(str, Size));
167 operator bool() const
202#if defined(ONIXS_HKEX_OMDC_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_HKEX_OMDC_COMPILER_CXX_RVALUE_REFERENCES
206 : data_(std::move(other.data_))
207 , size_(std::move(other.size_))
213 BinaryMessage&& other)
219 data_ = std::move(other.data_);
220 size_ = std::move(other.size_);
#define ONIXS_HKEX_OMDC_EXPLICIT
#define ONIXS_HKEX_OMDC_COLDPATH
#define ONIXS_HKEX_OMDC_NOTHROW
#define ONIXS_HKEX_OMDC_NULLPTR
#define ONIXS_HKEX_OMDC_NORETURN
Exposes base services to access fields stored in little Endian block of memory.
Enumeration::Enum enumeration(BlockSize offset) const noexcept
Returns value of a field by its offset.
const FieldValue & ordinaryRef(BlockSize offset) const noexcept
Returns value of a field by its offset.
StrRef fixedStr(BlockSize offset) const noexcept
Provides access to string field by its offset.
const SubMessage submessage(BlockSize offset, BlockSize size) const noexcept
Returns sub message.
FieldValue ordinary(BlockSize offset) const noexcept
Returns value of a field by its offset.
Encapsulates services for manipulating little endian encoded messages.
const void * binary() const noexcept
Message content.
MessageSize BinarySize
Length of message binary data.
MessageSize binarySize() const noexcept
Size of message.
BinaryMessage(const BinaryMessage &other) noexcept
Initializes instance as copy of the other one.
BinaryMessage(const void *data, MessageSize size) noexcept
Initializes instance over given memory block.
BinaryMessage() noexcept
Initializes blank instance referencing to nothing.
Provides efficient way of accessing text-based FIX field values.
char Char
Character type alias.
UInt16 MessageSize
Aliases message length type.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance) noexcept
Advances given pointer to a given offset (distance) in bytes.
FieldValue unalignedCopy(const void *p) noexcept
ONIXS_HKEX_OMDC_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)