44template<
typename Message>
inline
47 if ONIXS_ICEBOE_UNLIKELY(length < minimalRequiredLength)
63template <
class Container,
class BlockLength >
67 const Container& container()
const noexcept
69 return *
static_cast <const Container*
> (
this);
79 template <
typename Value>
80 ONIXS_ICEBOE_FORCEINLINE
81 Value
ordinary(BlockLength offset)
const noexcept
83 assert(container().blockLength() >= (offset +
size<Value>()) &&
"The requested field exceeds provided block boundaries.");
85 const void*
const location =
advanceByBytes(container().block(), offset);
89 template <
typename NullValue>
90 ONIXS_ICEBOE_FORCEINLINE
97 template <
typename NullValue>
98 ONIXS_ICEBOE_FORCEINLINE
102 using Value =
typename NullValue::Value;
104 if(since > container().version())
110 template <
typename NullValue>
111 ONIXS_ICEBOE_FORCEINLINE
115 using Value =
typename NullValue::Value;
117 assert(container().blockLength() >= (offset +
size<Value>()) &&
"The requested field exceeds provided block boundaries.");
121 const void*
const location =
advanceByBytes(container().block(), offset);
125 template <
typename NullValue>
126 ONIXS_ICEBOE_FORCEINLINE
132 if(since > container().version())
133 return RetType::null();
139 template <
typename Enumeration>
140 ONIXS_ICEBOE_FORCEINLINE
143 using Base =
typename underlyingType<Enumeration>::type;
148 template <
typename Enumeration,
typename NullValue>
149 ONIXS_ICEBOE_FORCEINLINE
152 using Base =
typename underlyingType<Enumeration>::type;
157 template <
typename Enumeration,
typename NullValue>
158 ONIXS_ICEBOE_FORCEINLINE
161 if(since > container().version())
168 template <BlockLength Length>
169 ONIXS_ICEBOE_FORCEINLINE
172 assert(container().blockLength() >= (offset + Length) &&
"The requested field exceeds provided block boundaries.");
178 template<BlockLength Length>
179 ONIXS_ICEBOE_FORCEINLINE
185 template<BlockLength Length>
186 ONIXS_ICEBOE_FORCEINLINE
189 if(since > container().version())
195 template <
typename Value>
196 ONIXS_ICEBOE_FORCEINLINE
197 Value
decimal(BlockLength offset)
const noexcept
202 template <
typename NullValue>
204 ONIXS_ICEBOE_FORCEINLINE
207 using Value =
typename NullValue::Value;
209 assert(container().blockLength() >= (offset +
size<Value>()) &&
"The requested field exceeds provided block boundaries.");
212 const void*
const location =
advanceByBytes(container().block(), offset);
216 template <
typename NullValue>
217 ONIXS_ICEBOE_FORCEINLINE
221 if(since > container().version())
227 template <
typename NullValue,
typename Callable>
228 ONIXS_ICEBOE_FORCEINLINE
232 typedef typename ArgType<Callable>::type InputType;
233 typedef decltype(std::declval<Callable>()(std::declval<InputType>())) ReturnType;
235 static_assert(!std::is_convertible<InputType, ReturnType>::value,
"Direct conversion can be done.");
245 template <
typename Callable>
246 ONIXS_ICEBOE_FORCEINLINE
247 auto convertible(BlockLength offset)
const noexcept(
noexcept(Callable::Nothrow))
248 ->
decltype(std::declval<Callable>()(std::declval<
typename ArgType<Callable>::type>()))
250 typedef typename ArgType<Callable>::type InputType;
259template <
class Container,
class BlockLength >
264 ONIXS_ICEBOE_FORCEINLINE
267 return *
static_cast<Container*
>(
this);
274 const BlockLength encodedBlockLength =
container().blockLength();
276 assert(encodedBlockLength >= offset);
278 const size_t paddingLength = encodedBlockLength - offset;
283 template<
class FieldValue>
284 ONIXS_ICEBOE_FORCEINLINE
287 assert(
container().blockLength() >= (offset +
size<FieldValue>()) &&
"The requested field exceeds provided block boundaries.");
294 template<
class FieldValue>
295 ONIXS_ICEBOE_FORCEINLINE
298 if ONIXS_ICEBOE_UNLIKELY(since >
container().version())
305 template<
class Enumeration>
306 ONIXS_ICEBOE_FORCEINLINE
309 using Base =
typename underlyingType<Enumeration>::type;
314 template<
class Enumeration>
315 ONIXS_ICEBOE_FORCEINLINE
318 using Base =
typename underlyingType<Enumeration>::type;
319 setOrdinary(offset,
static_cast<Base
>(value), since);
323 template<BlockLength Size>
324 ONIXS_ICEBOE_FORCEINLINE
327 assert(
container().blockLength() >= (offset + Size) &&
"The requested field exceeds provided block boundaries.");
328 assert(value.size() <= Size &&
"The string is truncated.");
331 const size_t sizeToCopy = (std::min)(Size,
static_cast<BlockLength
>(value.size()));
334 std::memcpy(fieldPos, value.data(), sizeToCopy);
336 std::memset(
advanceByBytes(fieldPos, sizeToCopy), 0, Size - sizeToCopy);
340 template<BlockLength Size>
341 ONIXS_ICEBOE_FORCEINLINE
344 if ONIXS_ICEBOE_UNLIKELY(since >
container().version())
358template <
class BodySizeType>
386 return (encoded_ !=
nullptr);
440template <
class EntryType,
class BlockLength,
class NumInGroup,
class Length >
488 return (entry_ !=
nullptr);
497 return Entry(entry_, size_, version_);
507 bool operator == (
const Iterator& other)
const noexcept
509 return entry_ == other.entry_;
513 bool operator !=(
const Iterator& other)
const noexcept
515 return entry_ != other.entry_;
519 bool operator < (
const Iterator& other)
const noexcept
521 return entry_ < other.entry_;
525 bool operator > (
const Iterator& other)
const noexcept
527 return entry_ > other.entry_;
586 , blockLength_(blockLength)
591 assert(blockLength > 0);
592 assert(version != 0);
598 return (
nullptr != encoded_);
616 return Iterator(
encoded(), blockLength_, version_);
630 assert(index < size_);
633 return Entry(
advanceByBytes(encoded_,
static_cast<ptrdiff_t
>(index) * blockLength_), blockLength_, version_);
649 template<
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength >
651 : encoded_(other.encoded_)
652 , blockLength_(other.blockLength_)
654 , version_(other.version_)
659 assert(blockLength_ == other.blockLength_);
660 assert(size_ == other.size_);
663 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
664 SbeGroupEntries& operator = (
const SbeGroupEntries <OtherEntry, OtherBlockLength, OtherNumInGroup, OtherLength>& other)
noexcept
666 encoded_ = other.encoded_;
668 blockLength_ = other.blockLength_;
670 assert(blockLength_ == other.blockLength_);
674 assert(size_ == other.size_);
676 version_ = other.version_;
683 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
friend class SbeGroupEntries;
686 BlockLength blockLength_;
692template <
class EntryType,
class DimensionType,
class GroupSizeType >
709 typedef SbeGroupEntries <EntryType, typename Dimension::BlockLength, typename Dimension::NumInGroup, GroupSizeType >
Entries;
732 : header_(
static_cast <Dimension*
>(data))
746 return (entries_ !=
nullptr);
794 assert(index <
size());
806 return Entries (entries_, header_->blockLength(), header_->numInGroup(), version_);
816 ONIXS_ICEBOE_FORCEINLINE
817 const void*
tail() const noexcept
849 void init(EntrySize entrySize)
noexcept
854 Dimension*
const group =
static_cast<Dimension*
>(header_);
855 group->blockLength(entrySize);
856 group->numInGroup(0);
860 Size allocate(Size entryCount,
const void* messageTail,
const void* blockEnd)
866 Dimension*
const group =
static_cast<Dimension*
>(header_);
868 const EntrySize entrySize = group->blockLength();
870 if ONIXS_ICEBOE_UNLIKELY(
871 entrySize < EntryType::blockLength(version_))
876 const Size oldEntryCount = group->numInGroup();
878 if(oldEntryCount == entryCount)
881 const ptrdiff_t memShift =
882 (entryCount - oldEntryCount) *
static_cast<ptrdiff_t
>(entrySize);
884 const void*
const newMessageTail =
885 advanceByBytes(messageTail, memShift);
887 if ONIXS_ICEBOE_UNLIKELY(byteDistance(blockEnd, newMessageTail) < 0)
888 throwNotEnoughSpace();
890 const
void* const oldEndOfGroup =
891 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * oldEntryCount);
893 void* const newEndGroup =
894 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * entryCount);
899 byteDistance(messageTail, oldEndOfGroup));
901 group->numInGroup(entryCount);
903 return oldEntryCount;
908 void setup(Size entryCount, const
void* messageTail, const
void* blockEnd)
914 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
916 for(Size index = oldEntryCount; index < entryCount; ++index)
917 zeroPaddingBytes((*
this)[index].resetVariableFields());
922 void construct(Size entryCount,
const void* messageTail,
const void* blockEnd)
928 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
930 for(Size index = oldEntryCount; index < entryCount; ++index)
931 zeroPaddingBytes((*
this)[index].reset());
935 static void zeroPaddingBytes(Entry& entry)
937 assert(entry.valid());
938 entry.zeroPaddingBytes(EntryType::minimalBlockLength(entry.version()));
950template <
class BinarySize >
970 template<
class BinaryVariableLengthFieldType>
971 BinaryVariableLengthFieldType&
head() const noexcept
973 return *
static_cast<BinaryVariableLengthFieldType*
>(binary_);
984 assert(headSize <= size_);
995 if ONIXS_ICEBOE_UNLIKELY(
empty() || (size_ < BinaryVariableLengthFieldType::Size))
1002 if ONIXS_ICEBOE_UNLIKELY(headSize > size_)
1018template <
class BinarySize>
1034 return (0 == size_);
1043 return Group(binary_, size_, version_);
1052 const BinarySize headSize =
head<Group>().binarySize();
1054 assert(headSize <= size_);
1065 const BinarySize headSize =
head<Group>().binarySize();
1067 assert(headSize <= size_);
1078 const BinarySize headSize = checkHead<Group>();
1089 const BinarySize headSize = checkHead<Group>();
1095 template<
class Group>
1096 BinarySize checkHead()
const
1098 if ONIXS_ICEBOE_UNLIKELY(size_ < Group::Dimension::Size)
1103 const Group group = head<Group>();
1105 const BinarySize headSize = group.binarySize();
1107 if ONIXS_ICEBOE_UNLIKELY(headSize > size_)
1114 const BinarySize entrySize = group.entrySize();
1115 const BinarySize expectedEntrySize = Group::Entry::minimalBlockLength(version_);
1117 if ONIXS_ICEBOE_UNLIKELY(entrySize < expectedEntrySize)
1119 throwBadBinaryBlock();
1132template<
typename Traits>
1135 if ONIXS_ICEBOE_UNLIKELY(version < Traits::MinimalVersion)
1142template<
typename Traits>
1147 if ONIXS_ICEBOE_UNLIKELY(version < since)
1154template<
typename Traits>
1157 if ONIXS_ICEBOE_UNLIKELY(
id != Traits::Id)
1164template<
typename Traits>
1250 return (
nullptr != header_);
1253 explicit operator bool() const noexcept
1263 return header_->templateId();
1271 return header_->version();
1279 return header_->schemaId();
1287 return header_->sequenceId();
1295 header_->sequenceId(value);
1305 return header_->sendTime();
1314 header_->sendTime(value);
1324 return header_->headerFlags();
1332 header_->headerFlags(value);
1388 return header_->blockLength();
1431 return GroupList(list, listSize, header_->version());
1444 return GroupList(
const_cast<void*
>(list), listSize, header_->version());
1448 template<
typename Group>
1450 void initGroup(Group& group,
typename Group::EntrySize entrySize)
noexcept
1452 assert(group.valid());
1453 group.init(entrySize);
1457 template<
typename Group>
1459 void setupGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1461 assert(messageTail);
1462 assert(group.valid());
1463 group.setup(entryCount, messageTail,
blockEnd());
1467 template<
typename Group>
1469 void constructGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1471 assert(messageTail);
1472 assert(group.valid());
1473 group.construct(entryCount, messageTail,
blockEnd());
1477 template<
typename DATA>
1480 assert(oldMessageTail);
1482 const ptrdiff_t lengthChange =
static_cast<ptrdiff_t
>(value.length() - data.length());
1484 const void*
const newMessageTail =
advanceByBytes(oldMessageTail, lengthChange);
1489 const void*
const oldEndOfData =
advanceByBytes(data.varData().data(), data.varData().size());
1493 std::memmove(newEndOfData, oldEndOfData,
byteDistance(oldMessageTail, oldEndOfData));
1495 data.varData(value);
1537 header_->templateId(value);
1539 header_->schemaId(
id);
1540 header_->sequenceId(0);
1554 assert(distance > 0);
1556 assert(distance <= (std::numeric_limits<MessageSize>::max)());
1560 assert(
size <= size_);
1566 template<
class Callable,
class Owner>
1573 template<
class Callable,
class Owner>
1576 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1583 template<
class Callable,
class Owner>
1586 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1587 return callable(owner).varData();
1591 template<
class Callable,
class Owner>
1594 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1601 template<
class Callable,
class Owner>
1604 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1605 callable(owner).length(0);
1609 template<
class Group,
class Callable,
class Owner>
1612 const typename Group::EntrySize entrySize = Group::Entry::blockLength(
version());
1614 Group grp = callable(owner);
1620 template<
class Callable,
class Owner>
1623 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1630 template<
class Group,
class Callable,
class Owner>
1633 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1640 template<
class Group,
class Callable,
class Owner>
1641 ONIXS_ICEBOE_FORCEINLINE
1642 Group
getGroup(Callable callable, Owner& owner)
const noexcept
1644 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1645 return callable(owner);
1649 template<
class Group,
class Callable,
class Owner>
1650 ONIXS_ICEBOE_FORCEINLINE
1653 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1660 template<
class Group,
class Callable,
class Owner>
1661 ONIXS_ICEBOE_FORCEINLINE
1664 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1671 template<
class Group,
class Callable,
class Owner>
1672 ONIXS_ICEBOE_FORCEINLINE
1675 Group group = callable(owner);
1683 template<
class Group,
class Callable,
class Owner>
1686 if ONIXS_ICEBOE_UNLIKELY(since >
version())
1693 template<
class Group,
class Callable,
class Owner>
1694 Group
setupGroup(Callable callable,
typename Group::Size length, Owner& owner)
1696 Group group = callable(owner);
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_END
#define ONIXS_ICEBOE_HOTPATH
#define ONIXS_ICEBOE_UNUSED
#define ONIXS_ICEBOE_EXPORTED
#define ONIXS_ICEBOE_NODISCARD
~BinaryBlockBase()=default
ONIXS_ICEBOE_FORCEINLINE std::enable_if<!isComposite< typenameNullValue::Value >::value, SbeOptional< typenameNullValue::Value, NullValue > >::type ordinary(BlockLength offset, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE Enumeration enumeration(BlockLength offset) const noexcept
SbeOptional< typename NullValue::Value, NullValue > ONIXS_ICEBOE_FORCEINLINE decimal(BlockLength offset, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE std::enable_if< isComposite< typenameNullValue::Value >::value, SbeOptional< typenameNullValue::Value, NullValue > >::type ordinary(BlockLength offset, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE SbeOptional< typename NullValue::Value, NullValue > decimal(BlockLength offset, SchemaVersion since, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE Value ordinary(BlockLength offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE SbeOptionalStr fixedStr(BlockLength offset, SchemaVersion since, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE Value decimal(BlockLength offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE std::enable_if<!isComposite< typenameNullValue::Value >::value, SbeOptional< typenameNullValue::Value, NullValue > >::type ordinary(BlockLength offset, SchemaVersion since, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE SbeOptionalEnumeration< Enumeration, NullValue > enumeration(BlockLength offset, OptionalTag) const noexcept
Provides access to an optional field value.
ONIXS_ICEBOE_FORCEINLINE SbeOptionalStr fixedStr(BlockLength offset, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE StrRef fixedStr(BlockLength offset) const noexcept
Provides access to a string field value.
BinaryBlock()=default
Initializes a blank instance.
ONIXS_ICEBOE_FORCEINLINE std::enable_if< isComposite< typenameNullValue::Value >::value, SbeOptional< typenameNullValue::Value, NullValue > >::type ordinary(BlockLength offset, SchemaVersion since, OptionalTag) const noexcept
ONIXS_ICEBOE_FORCEINLINE SbeOptionalEnumeration< Enumeration, NullValue > enumeration(BlockLength offset, SchemaVersion since, OptionalTag) const noexcept
Provides access to an optional field value.
ONIXS_ICEBOE_FORCEINLINE std::enable_if<!isComposite< typenameNullValue::Value >::value, SbeOptionalConverted< decltype(std::declval< Callable >()(std::declval< typenameArgType< Callable >::type >()))> >::type convertible(BlockLength offset, OptionalTag) const noexcept(noexcept(Callable::Nothrow))
ONIXS_ICEBOE_FORCEINLINE auto convertible(BlockLength offset) const noexcept(noexcept(Callable::Nothrow)) -> decltype(std::declval< Callable >()(std::declval< typename ArgType< Callable >::type >()))
NumInGroup numInGroup() const noexcept
BlockLength blockLength() const noexcept
ONIXS_ICEBOE_FORCEINLINE void setEnumeration(BlockLength offset, Enumeration value) noexcept
Sets the field value.
ONIXS_ICEBOE_FORCEINLINE void setEnumeration(BlockLength offset, Enumeration value, SchemaVersion since)
Sets the field value.
ONIXS_ICEBOE_FORCEINLINE void setFixedStr(BlockLength offset, StrRef value, SchemaVersion since)
Sets the field value.
SbeFields()=default
Initializes a blank instance.
ONIXS_ICEBOE_FORCEINLINE void setOrdinary(BlockLength offset, FieldValue value, SchemaVersion since)
Sets the field value.
ONIXS_ICEBOE_FORCEINLINE void setOrdinary(BlockLength offset, FieldValue value) noexcept
Sets the field value.
void zeroPaddingBytes(BlockLength offset) noexcept
If specified, the extra space is padded at the end of each entry and should be set to zeroes by encod...
ONIXS_ICEBOE_FORCEINLINE Container & container() noexcept
ONIXS_ICEBOE_FORCEINLINE void setFixedStr(BlockLength offset, StrRef value) noexcept
Sets the field value.
An iterator over SBE-encoded group entries.
Iterator(void *entry, Size size, SchemaVersion version) noexcept
Initializes the instance to the given repeating group.
std::random_access_iterator_tag iterator_category
Iterator() noexcept
Initializes the instance that refers to nothing.
bool valid() const noexcept
ptrdiff_t difference_type
SbeGroupEntries() noexcept
Initializes a blank instance referencing to nothing.
bool empty() const noexcept
SbeGroupEntries(void *encoded, BlockLength blockLength, Size groupSize, SchemaVersion version) noexcept
Initializes the instance referencing to data.
EntryType Entry
The type of the repeating group entry.
Iterator end() const
Returns the iterator pointing to the entry behind the end of the group.
Size size() const noexcept
EncodedLength encodedLength() const noexcept
SbeGroupEntries(const SbeGroupEntries< OtherEntry, OtherBlockLength, OtherNumInGroup, OtherLength > &other) noexcept
Copy constructor.
bool valid() const noexcept
friend class SbeGroupEntries
Length EncodedLength
The length of the binary data occupied by the group entries.
NumInGroup Size
Number of entries in the collection.
void * encoded() const noexcept
SbeGroupEntry()
Initializes a blank instance.
const void * block() const noexcept
SbeGroupEntry(void *encoded, BlockLength size, SchemaVersion version)
Initializes the instance from the memory block of the encoded message.
SchemaVersion version() const noexcept
bool valid() const noexcept
const void * encoded() const noexcept
BlockLength blockLength() const noexcept
void * encoded() noexcept
GroupSizeEncoding::BlockLength BlockLength
SbeVariableLengthFieldList< BinarySize > checkVariableLengthFields() const
Checks the variable length fields list consistency.
bool empty() const noexcept
SbeGroupList tail() const noexcept
SbeGroupList checkTail() const
Checks the list consistency.
Group head() const noexcept
SbeVariableLengthFieldList< BinarySize > variableLengthFields() const noexcept
SbeGroupList(void *binary, BinarySize size, SchemaVersion version) noexcept
Initializes the list over the memory block.
SbeGroup() noexcept
Initializes a blank instance referencing to nothing.
EntrySize entrySize() const noexcept
ONIXS_ICEBOE_FORCEINLINE const void * tail() const noexcept
BinarySize binarySize() const noexcept
bool empty() const noexcept
GroupSizeEncoding::BlockLength EntrySize
SbeGroup(void *data, BinarySize size, SchemaVersion version) noexcept
Initializes an instance referencing to a valid group of a given message.
Entries::Iterator Iterator
Entries entries() const noexcept
void * binary() const noexcept
Size size() const noexcept
Iterator end() const noexcept
bool valid() const noexcept
const void * encoded() const noexcept
SbeGroupEntries< BlockDetailsEntry, typename Dimension::BlockLength, typename Dimension::NumInGroup, MessageSize > Entries
GroupSizeEncoding Dimension
Iterator begin() const noexcept
void clear() noexcept
Blank the instance.
const void * binary() const noexcept
MessageTemplateId templateId() const noexcept
SbeMessage & headerFlags(HeaderFlags value) noexcept
Sets Send Time.
SchemaId schemaId() const noexcept
Group setupGroup(Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
Setups the repeating group with the given number of entries.
const void * blockEnd() noexcept
GroupList groups() const noexcept
Group setupGroup(Callable callable, typename Group::Size length, Owner &owner)
Setups the repeating group with the given number of entries.
StrRef getVariableLengthField(Callable callable, SchemaVersion since, Owner &owner) const noexcept
const void * blockEnd() const noexcept
void setVariableLengthField(Callable callable, StrRef value, SchemaVersion since, Owner &owner)
Sets the value of the variable length field.
SbeMessage(void *data, MessageSize size)
Initializes the instance over the given memory block.
SbeVariableLengthFieldList< MessageSize > VariableLengthFieldList
Binary group list instantiation.
GroupList groups() noexcept
SbeMessage & sequenceId(SequenceId value) noexcept
Sets Sequence ID.
SbeMessage & version(SchemaVersion version) noexcept
Sets the SBE Schema version.
ONIXS_ICEBOE_FORCEINLINE Group constructGroup(Callable callable, typename Group::Size length, Owner &owner)
Creates a repeating group with the given number of entries, sets all optional fields of the group ent...
Timestamp sendTime() const noexcept
MessageSize EncodedLength
Length of the message binary data.
const void * block() const noexcept
void setVarDataField(DATA &data, StrRef value, const void *oldMessageTail)
Sets the variable length field value.
SbeMessage(void *data, MessageSize size, NoCheck) noexcept
Initializes the instance over the given memory block.
ONIXS_ICEBOE_FORCEINLINE Group getGroup(Callable callable, SchemaVersion since, Owner &owner) const noexcept
void initGroup(Group &group, typename Group::EntrySize entrySize) noexcept
Resets the group to the initial state.
void setupGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header.
VariableLengthFieldList variableLengthFields() const noexcept
SchemaVersion version() const noexcept
SbeGroupList< MessageSize > GroupList
Binary group list instantiation.
SbeMessage(void *data, MessageSize size, SchemaVersion version)
Initializes the instance over the given memory block.
MessageSize bufferSize() const noexcept
bool valid() const noexcept
SequenceId sequenceId() const noexcept
SbeMessage & sendTime(Timestamp value) noexcept
Sets Send Time.
ONIXS_ICEBOE_FORCEINLINE Group constructGroup(Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
Creates a repeating group with the given number of entries, sets all optional fields of the group ent...
static constexpr MessageSize getMaxMessageSize() noexcept
Maximal message size.
void setVariableLengthFieldToNull(Callable callable, SchemaVersion since, Owner &owner) noexcept
Sets the variable length field to null.
BlockLength blockLength() const noexcept
void setVariableLengthFieldToNull(Callable callable, Owner &owner) noexcept
Resets the variable length field.
void resetGroup(Callable callable, SchemaVersion since, Owner &owner)
Resets the repeating group.
SbeMessage() noexcept
Initializes a blank instance.
void setVariableLengthField(Callable callable, StrRef value, Owner &owner)
Sets the value of the variable length field.
void init(MessageHeader::TemplateId value, MessageHeader::BlockLength minimalBlockLength, MessageHeader::BlockLength blockLength, SchemaId id) noexcept
ONIXS_ICEBOE_FORCEINLINE Group getGroup(Callable callable, Owner &owner) const noexcept
VariableLengthFieldList variableLengthFields() noexcept
MessageSize BlockLength
Length of the message body representing a block of fixed-length fields.
HeaderFlags headerFlags() const noexcept
StrRef getVariableLengthField(Callable callable, const Owner &owner) const noexcept
void resetGroup(Callable callable, Owner &owner) noexcept
Sets the group to the initial state.
MessageSize calculateBinarySize(const void *tail) const noexcept
void constructGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header, sets all optional fields to null.
static ONIXS_ICEBOE_FORCEINLINE constexpr SbeOptionalEnumeration< T, Null > null() noexcept
Variable-length fields list.
bool empty() const noexcept
SbeVariableLengthFieldList(void *binary, BinarySize size, SchemaVersion version) noexcept
Initializes the list over the given memory block.
SbeVariableLengthFieldList tail() const noexcept
BinaryVariableLengthFieldType & head() const noexcept
SbeVariableLengthFieldList checkTail() const
Checks the variable-length field list consistency.
The time point without the time-zone information.
void throwBadSchemaId(SchemaId expected, SchemaId provided)
Raises an exception on a bad message id.
void checkSchemaId(SchemaId id)
Checks the compatibility with the provided SBE Schema ID.
ONIXS_ICEBOE_FORCEINLINE std::enable_if< details::HasMemberTraits< Value >::value, Value >::type getValue(const void *location) noexcept(noexcept(makeFromTuple< Value >(CompositeExtractor< Value::MemberTraits::Count >::template extractAsTuple< Value >(location))))
void checkBinaryLength(const Message &, MessageSize length, MessageSize minimalRequiredLength)
constexpr std::enable_if<!details::HasMemberTraits< Value >::value, size_t >::type size() noexcept
ONIXS_ICEBOE_FORCEINLINE std::enable_if<!details::HasValueStaticMember< Value >::value >::type setValue(void *location, Value value) noexcept
void throwDisallowedField()
Throws an exception on a bad repeating group entry.
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
constexpr UInt16 MaxSbeMessageSize
Maximum supported message size.
char Char
Character type alias.
ONIXS_ICEBOE_FORCEINLINE void * toOpaquePtr(Type *ptr) noexcept
Makes the pointer an opaque one.
ONIXS_ICEBOE_FORCEINLINE Type * advanceByBytes(Type *pointer, ptrdiff_t distance) noexcept
Advances the pointer to a given offset (distance) in bytes.
void throwBinaryBlockIsTooSmall(MessageSize actual, MessageSize required)
Raises an exception when the given binary block is too small.
void throwNotEnoughSpace()
Throws an exception on a bad repeating group entry.
UInt16 MessageSize
Message length type.
HeaderFlags
HeaderFlags type.
std::basic_string_view< Char > StrRef
void checkVersion(SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
MessageHeader::SchemaId SchemaId
void checkSchema(SchemaId id, SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
ONIXS_ICEBOE_FORCEINLINE Byte * toByteBlock(Type *ptr) noexcept
Reinterprets the pointer as a byte block one.
void throwBadBinaryBlock()
Throws an exception on a bad repeating group.
ONIXS_ICEBOE_FORCEINLINE ptrdiff_t byteDistance(Left *left, Right *right) noexcept
MessageHeader::SequenceId SequenceId
ONIXS_ICEBOE_FORCEINLINE Type * advanceBackByBytes(Type *pointer, ptrdiff_t distance) noexcept
ONIXS_ICEBOE_FORCEINLINE std::enable_if<(MaxLen<=16), size_t >::type stringLen(const Char *s) noexcept
constexpr OptionalTag optional
void throwBadMessageVersion(SchemaVersion messageVersion, SchemaVersion minimalVersion)
Raises an exception on a bad message version.
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.