OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
SbeVariableLengthFieldList< BinarySize > Class Template Reference

Public Member Functions

 SbeVariableLengthFieldList (void *binary, BinarySize size, SchemaVersion version) noexcept
bool empty () const noexcept
template<class BinaryVariableLengthFieldType>
BinaryVariableLengthFieldType & head () const noexcept
template<class BinaryVariableLengthFieldType>
SbeVariableLengthFieldList tail () const noexcept
template<class BinaryVariableLengthFieldType>
SbeVariableLengthFieldList checkTail () const

Detailed Description

template<class BinarySize>
class OnixS::ICE::BOE::Messaging::SbeVariableLengthFieldList< BinarySize >

Definition at line 951 of file SbeMessage.h.

Constructor & Destructor Documentation

◆ SbeVariableLengthFieldList()

template<class BinarySize>
SbeVariableLengthFieldList ( void * binary,
BinarySize size,
SchemaVersion version )
inlinenoexcept

Initializes the list over the given memory block.

Definition at line 956 of file SbeMessage.h.

957 : binary_(binary)
958 , size_(size)
959 , version_(version)
960 {
961 }

Member Function Documentation

◆ checkTail()

template<class BinarySize>
template<class BinaryVariableLengthFieldType>
SbeVariableLengthFieldList checkTail ( ) const
inline

Checks the variable-length field list consistency.

Returns
the list of fields following the head.

Definition at line 993 of file SbeMessage.h.

994 {
995 if ONIXS_ICEBOE_UNLIKELY(empty() || (size_ < BinaryVariableLengthFieldType::Size))
996 {
998 }
999
1000 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
1001
1002 if ONIXS_ICEBOE_UNLIKELY(headSize > size_)
1003 {
1005 }
1006
1007 return SbeVariableLengthFieldList(advanceByBytes(binary_, headSize), size_ - headSize, version_);
1008 }
ONIXS_ICEBOE_FORCEINLINE Type * advanceByBytes(Type *pointer, ptrdiff_t distance) noexcept
Advances the pointer to a given offset (distance) in bytes.
Definition Memory.h:110
void throwBadBinaryBlock()
Throws an exception on a bad repeating group.

◆ empty()

template<class BinarySize>
bool empty ( ) const
inlinenoexcept
Returns
true if the list is empty, otherwise - `false.

Definition at line 964 of file SbeMessage.h.

965 {
966 return (0 == size_);
967 }

◆ head()

template<class BinarySize>
template<class BinaryVariableLengthFieldType>
BinaryVariableLengthFieldType & head ( ) const
inlinenoexcept
Returns
the head of the list.

Definition at line 971 of file SbeMessage.h.

972 {
973 return *static_cast<BinaryVariableLengthFieldType*>(binary_);
974 }

◆ tail()

template<class BinarySize>
template<class BinaryVariableLengthFieldType>
SbeVariableLengthFieldList tail ( ) const
inlinenoexcept
Returns
the list of variable-length fields following the head.

Definition at line 978 of file SbeMessage.h.

979 {
980 assert(!empty());
981
982 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
983
984 assert(headSize <= size_);
985
986 return SbeVariableLengthFieldList(advanceByBytes( binary_, headSize), size_ - headSize, version_);
987 }