25 #include <OnixS/FenicsUST/MarketData/Bimp/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));
151 : data_(ONIXS_FENICSUST_BIMP_NULLPTR)
177 operator bool() const
180 return (ONIXS_FENICSUST_BIMP_NULLPTR != data_);
212 #if defined(ONIXS_FENICSUST_BIMP_COMPILER_CXX_RVALUE_REFERENCES) && ONIXS_FENICSUST_BIMP_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_FENICSUST_BIMP_API
#define ONIXS_FENICSUST_BIMP_NORETURN
const SubMessage submessage(BlockSize offset, BlockSize size) const ONIXS_FENICSUST_BIMP_NOTHROW
Returns sub message.
const void * binary() const ONIXS_FENICSUST_BIMP_NOTHROW
Message content.
#define ONIXS_FENICSUST_BIMP_COLD_PATH
ONIXS_FENICSUST_BIMP_API ONIXS_FENICSUST_BIMP_COLD_PATH ONIXS_FENICSUST_BIMP_NORETURN void throwIncorrectSize(const std::string &messageName, MessageSize receivedSize, MessageSize expectedSize)
BinaryMessage(const void *data, MessageSize size) ONIXS_FENICSUST_BIMP_NOTHROW
Initializes instance over given memory block.
BinaryMessage() ONIXS_FENICSUST_BIMP_NOTHROW
Initializes blank instance referencing to nothing.
Enumeration::Enum enumeration(BlockSize offset) const ONIXS_FENICSUST_BIMP_NOTHROW
Provides efficient way of accessing text-based FIX field values.
MessageSize binarySize() const ONIXS_FENICSUST_BIMP_NOTHROW
Size of message.
#define ONIXS_FENICSUST_BIMP_NOTHROW
Type * advanceByBytes(Type *pointer, ptrdiff_t distance) ONIXS_FENICSUST_BIMP_NOTHROW
Advances given pointer to a given offset (distance) in bytes.
Encapsulates services for manipulating little endian encoded messages.
StrRef fixedStr(BlockSize offset) const ONIXS_FENICSUST_BIMP_NOTHROW
MessageSize BinarySize
Length of message binary data.
FieldValue ordinary(BlockSize offset) const ONIXS_FENICSUST_BIMP_NOTHROW
Returns value of a field by its offset.
char Char
Character type alias.
const FieldValue & ordinaryRef(BlockSize offset) const ONIXS_FENICSUST_BIMP_NOTHROW
Returns value of a field by its offset.
Integer2 MessageSize
Aliases message length type.
#define ONIXS_FENICSUST_BIMP_EXPLICIT
BinaryMessage(const BinaryMessage &other) ONIXS_FENICSUST_BIMP_NOTHROW
Initializes instance as copy of the other one.