25 #include <OnixS/EuroTLX/MarketData/GTP/Export.h> 45 template <
class Block,
class BlockSize>
50 const Block& block()
const 53 return *
static_cast<const Block*
>(
this);
58 template <
class FieldValue>
62 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
65 unalignedCopy<FieldValue>(
advanceByBytes(block().binary(), offset));
69 template <
class FieldValue>
73 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
76 *static_cast <
const FieldValue*>(
advanceByBytes(block().binary(), offset));
83 template <
class Enumeration>
84 typename Enumeration::Enum
enumeration(BlockSize offset)
const 87 typedef typename Enumeration::Base Base;
89 typedef typename Enumeration::Enum Enum;
91 return static_cast<Enum
>(ordinary<Base>(offset));
98 template <BlockSize Size>
104 return StrRef(ordinaryRef<Str>(offset), strnlen(ordinaryRef<Str>(offset),
Size));
121 : data_(ONIXS_EUROTLX_GTP_NULLPTR)
147 operator bool() const
150 return (ONIXS_EUROTLX_GTP_NULLPTR != data_);
182 #if defined(ONIXS_EUROTLX_GTP_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_EUROTLX_GTP_COMPILER_CXX_RVALUE_REFERENCES 186 : data_(std::move(other.data_))
187 , size_(std::move(other.size_))
199 data_ = std::move(other.data_);
200 size_ = std::move(other.size_);
208 ONIXS_EUROTLX_GTP_API
#define ONIXS_EUROTLX_GTP_EXPLICIT
BinaryMessage() ONIXS_EUROTLX_GTP_NOTHROW
Initializes blank instance referencing to nothing.
#define ONIXS_EUROTLX_GTP_NOTHROW
MessageSize binarySize() const ONIXS_EUROTLX_GTP_NOTHROW
Size of message.
const void * binary() const ONIXS_EUROTLX_GTP_NOTHROW
Message content.
UInt16 MessageSize
Aliases message length type.
ONIXS_EUROTLX_GTP_API void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
FixedPointDecimal< UInt64, IntegralConstant< Int8,-8 > > Size
Little-Endian encoded 64 bit unsigned integer with eight implied decimal places.
char Char
Character type alias.
FieldValue ordinary(BlockSize offset) const ONIXS_EUROTLX_GTP_NOTHROW
Returns value of a field by its offset.
const FieldValue & ordinaryRef(BlockSize offset) const ONIXS_EUROTLX_GTP_NOTHROW
Returns value of a field by its offset.
BinaryMessage(const BinaryMessage &other) ONIXS_EUROTLX_GTP_NOTHROW
Initializes instance as copy of the other one.
StrRef fixedStr(BlockSize offset) const ONIXS_EUROTLX_GTP_NOTHROW
Enumeration::Enum enumeration(BlockSize offset) const ONIXS_EUROTLX_GTP_NOTHROW
Encapsulates services for manipulating little endian encoded messages.
Provides efficient way of accessing text-based FIX field values.
MessageSize BinarySize
Length of message binary data.
BinaryMessage(const void *data, MessageSize size) ONIXS_EUROTLX_GTP_NOTHROW
Initializes instance over given memory block.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance) ONIXS_EUROTLX_GTP_NOTHROW
Advances given pointer to a given offset (distance) in bytes.