25 #include <OnixS/CboeCFE/MarketData/Pitch/Export.h> 40 template <
class FieldValue>
45 return unalignedCopy<FieldValue>(p);
49 template<
class MantissaType,
class ExponentType>
55 unalignedCopy<typename FixedPointDecimal<MantissaType, ExponentType>::Mantissa>(p));
63 template <
class Block,
class BlockSize>
68 const Block& block()
const 71 return *
static_cast<const Block*
>(
this);
76 template <
class SubMessage>
77 const SubMessage
submessage(BlockSize offset, BlockSize size)
const 80 assert(block().binarySize() >= (offset + size));
87 template <
class FieldValue>
91 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
97 template <
class FieldValue>
101 assert(block().binarySize() >= (offset +
sizeof(FieldValue)));
104 *static_cast <
const FieldValue*>(
advanceByBytes(block().binary(), offset));
111 template <
class Enumeration>
115 typedef typename Enumeration::Base Base;
117 typedef typename Enumeration::Enum Enum;
119 return static_cast<Enum
>(ordinary<Base>(offset));
126 template <BlockSize Size>
130 typedef Char Str[Size];
132 const Str& str = ordinaryRef<Str>(offset);
134 return StrRef(str, strnlen(str, Size));
177 operator bool() const
212 #if defined(ONIXS_BATS_PITCH_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_BATS_PITCH_COMPILER_CXX_RVALUE_REFERENCES 216 : data_(std::move(other.data_))
217 , size_(std::move(other.size_))
229 data_ = std::move(other.data_);
230 size_ = std::move(other.size_);
238 ONIXS_CBOECFE_PITCH_API
239 ONIXS_BATS_PITCH_COLDPATH
240 ONIXS_BATS_PITCH_NORETURN
ONIXS_CBOECFE_PITCH_API ONIXS_BATS_PITCH_COLDPATH ONIXS_BATS_PITCH_NORETURN void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
const FieldValue & ordinaryRef(BlockSize offset) const ONIXS_BATS_PITCH_NOTHROW
Returns value of a field by its offset.
MessageSize BinarySize
Length of message binary data.
Provides efficient way of accessing text-based FIX field values.
Encapsulates services for manipulating little endian encoded messages.
#define ONIXS_BATS_PITCH_NULLPTR
BinaryMessage() ONIXS_BATS_PITCH_NOTHROW
Initializes blank instance referencing to nothing.
Enumeration::Enum enumeration(BlockSize offset) const ONIXS_BATS_PITCH_NOTHROW
char Char
Character type alias.
Binary2 MessageSize
Aliases message length type.
const SubMessage submessage(BlockSize offset, BlockSize size) const ONIXS_BATS_PITCH_NOTHROW
Returns sub message.
const void * binary() const ONIXS_BATS_PITCH_NOTHROW
Message content.
BinaryMessage(const BinaryMessage &other) ONIXS_BATS_PITCH_NOTHROW
Initializes instance as copy of the other one.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance) ONIXS_BATS_PITCH_NOTHROW
Advances given pointer to a given offset (distance) in bytes.
#define ONIXS_BATS_PITCH_NOTHROW
#define ONIXS_BATS_PITCH_EXPLICIT
FieldValue ordinary(BlockSize offset) const ONIXS_BATS_PITCH_NOTHROW
Returns value of a field by its offset.
MessageSize binarySize() const ONIXS_BATS_PITCH_NOTHROW
Size of message.
StrRef fixedStr(BlockSize offset) const ONIXS_BATS_PITCH_NOTHROW
BinaryMessage(const void *data, MessageSize size) ONIXS_BATS_PITCH_NOTHROW
Initializes instance over given memory block.