43 template<
typename Message>
inline 46 if ONIXS_B3_BOE_UNLIKELY(length < minimalRequiredLength)
47 throwBinaryBlockIsTooSmall(length, minimalRequiredLength, Message::className());
62 template < class Container, class BlockLength >
68 return *static_cast <
const Container*> (
this);
81 assert(container().blockLength() >= (offset + size<Value>()) &&
82 "The requested field exceeds provided block boundaries.");
84 const void*
const location = advanceByBytes(container().block(), offset);
85 return getValue<Value>(location);
92 assert(container().blockLength() >= (offset + size<Value>()) &&
93 "The requested field exceeds provided block boundaries.");
95 const void* location = advanceByBytes(container().block(), offset);
96 const Value* valuePtr =
static_cast<const Value*
>(location);
114 value = ordinary<Value>(offset);
116 return (null != value);
126 return (since <= container().version() && ordinary (value, offset, null ) );
133 typedef typename Enumeration::Base Base;
134 typedef typename Enumeration::Enum Enum;
136 return static_cast<Enum
>(ordinary<Base>(offset));
143 typedef typename Enumeration::Base Base;
144 typedef typename Enumeration::Enum Enum;
146 value = static_cast <Enum>(ordinary<Base>(offset));
147 return null != value;
154 return (since <= container().version() && enumeration<Enumeration>(value, offset, null) );
161 return ordinary<Value>(offset);
171 value = ordinary<Value>(offset);
172 return null != value;
182 return (since <= container().version() && decimal(value, offset, null));
189 assert(container().blockLength() >= (offset + Length) &&
"The requested field exceeds provided block boundaries.");
191 const Char*
const text = reinterpret_cast <
const Char*> (advanceByBytes(container().block(), offset));
193 return StrRef(text, strnlen(text, Length));
203 value = fixedStr<Length>(offset);
204 return !value.empty();
214 return (since <= container().version() && fixedStr<Length>(value, offset));
222 template <
class Container,
class BlockLength >
229 return *
static_cast<Container*
>(
this);
236 const BlockLength encodedBlockLength = container().blockLength();
238 assert(encodedBlockLength >= offset);
240 const size_t paddingLength = encodedBlockLength - offset;
241 std::memset(advanceByBytes(container().block(), offset), 0, paddingLength);
248 assert(container().blockLength() >= (offset + size<FieldValue>()) &&
"The requested field exceeds provided block boundaries.");
250 void*
const fieldPos = advanceByBytes(container().block(), offset);
251 setValue(fieldPos, value);
258 if ONIXS_B3_BOE_UNLIKELY(since > container().version())
259 throwDisallowedField();
261 setOrdinary(offset, value);
268 typedef typename Enumeration::Base Base;
269 setOrdinary<Base>(offset,
static_cast<Base
>(value));
276 typedef typename Enumeration::Base Base;
277 setOrdinary(offset, static_cast<Base>(value), since);
284 assert(container().blockLength() >= (offset + Size) &&
"The requested field exceeds provided block boundaries.");
285 assert(value.size() <= Size &&
"The string is truncated.");
287 void*
const fieldPos = advanceByBytes(container().block(), offset);
288 const size_t sizeToCopy = (std::min)(Size, static_cast<BlockLength>(value.size()));
291 std::memcpy(fieldPos, value.data(), sizeToCopy);
293 std::memset(advanceByBytes(fieldPos, sizeToCopy), 0, Size - sizeToCopy);
300 if ONIXS_B3_BOE_UNLIKELY(since > container().version())
301 throwDisallowedField();
303 setFixedStr<Size>(offset, value);
314 template <
class BodySizeType>
396 template <
class EntryType,
class BlockLength,
class NumInGroup,
class Length >
453 return Entry(entry_, size_, version_);
457 Entry operator *()
const 465 return entry_ == other.entry_;
471 return entry_ != other.entry_;
477 return entry_ < other.entry_;
483 return entry_ > other.entry_;
491 entry_ = advanceByBytes(entry_, size_);
501 entry_ = advanceBackByBytes(entry_, size_);
512 return Iterator(advanceByBytes(entry_, distance * size_), size_, version_);
521 return Iterator(advanceBackByBytes(entry_, distance * size_), size_, version_);
542 , blockLength_(blockLength)
547 assert(blockLength > 0);
548 assert(version != 0);
572 return Iterator(encoded(), blockLength_, version_);
578 return Iterator(advanceByBytes(encoded(), encodedLength()), blockLength_, version_);
584 Entry operator [](Size index)
const 586 assert(index < size_);
589 return Entry(advanceByBytes(encoded_, static_cast<ptrdiff_t>(index) * blockLength_), blockLength_, version_);
601 return (static_cast<EncodedLength>(blockLength_) * static_cast<EncodedLength>(size_) );
605 template<
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength >
607 : encoded_(other.encoded_)
608 , blockLength_(other.blockLength_)
610 , version_(other.version_)
615 assert(blockLength_ == other.blockLength_);
616 assert(size_ == other.size_);
619 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
622 encoded_ = other.encoded_;
624 blockLength_ = other.blockLength_;
626 assert(blockLength_ == other.blockLength_);
630 assert(size_ == other.size_);
632 version_ = other.version_;
639 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
friend class SbeGroupEntries;
642 BlockLength blockLength_;
648 template <
class EntryType,
class DimensionType,
class GroupSizeType >
659 enum { EmptySize = Dimension::Size };
680 , entries_(ONIXS_B3_BOE_NULLPTR)
688 : header_(static_cast <Dimension*>(data))
689 , entries_(advanceByBytes(data, Dimension::Size))
692 ONIXS_B3_BOE_ASSERT(size >= Dimension::Size);
720 const Dimension*
const group =
static_cast<const Dimension*
>(header_);
722 return group->numInGroup();
731 return Iterator(entries_, numericCast<EntrySize>(entrySize()), version_);
740 return Iterator(advanceByBytes(binary(), binarySize()), numericCast<EntrySize>(entrySize()), version_);
747 Entry operator [](Size index)
const 750 assert(index < size());
752 return Entry(advanceByBytes(entries_, static_cast<ptrdiff_t>(index) * entrySize()), entrySize(), version_);
762 return Entries (entries_, header_->blockLength(), header_->numInGroup(), version_);
774 return advanceByBytes(toByteBlock(encoded()), binarySize());
788 return Dimension::Size + (
static_cast<BinarySize
>(entrySize()) * static_cast<BinarySize>(size()));
798 Dimension*
const group =
static_cast<Dimension*
>(header_);
799 return group->blockLength();
809 Dimension*
const group =
static_cast<Dimension*
>(header_);
810 group->setBlockLength(entrySize);
811 group->setNumInGroup(0);
815 Size allocate(Size entryCount,
const void* messageTail,
const void* blockEnd)
821 Dimension*
const group =
static_cast<Dimension*
>(header_);
823 const EntrySize entrySize = group->blockLength();
825 if ONIXS_B3_BOE_UNLIKELY(
826 entrySize < EntryType::blockLength(version_))
828 throwBadBinaryBlock();
831 const Size oldEntryCount = group->numInGroup();
833 if(oldEntryCount == entryCount)
836 const ptrdiff_t memShift =
837 (entryCount - oldEntryCount) * static_cast<ptrdiff_t>(entrySize);
839 const void*
const newMessageTail =
840 advanceByBytes(messageTail, memShift);
842 if ONIXS_B3_BOE_UNLIKELY(byteDistance(blockEnd, newMessageTail) < 0)
843 throwNotEnoughSpace();
845 const void*
const oldEndOfGroup =
846 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * oldEntryCount);
848 void*
const newEndGroup =
849 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * entryCount);
854 byteDistance(messageTail, oldEndOfGroup));
856 group->setNumInGroup(entryCount);
858 return oldEntryCount;
863 void setup(Size entryCount,
const void* messageTail,
const void* blockEnd)
869 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
871 for(Size index = oldEntryCount; index < entryCount; ++index)
872 zeroPaddingBytes((*
this)[index].resetVariableFields());
877 void construct(Size entryCount,
const void* messageTail,
const void* blockEnd)
883 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
885 for(Size index = oldEntryCount; index < entryCount; ++index)
886 zeroPaddingBytes((*
this)[index].reset());
890 static void zeroPaddingBytes(Entry& entry)
892 assert(entry.valid());
893 entry.zeroPaddingBytes(EntryType::minimalBlockLength(entry.version()));
905 template <
class BinarySize >
925 template<
class BinaryVariableLengthFieldType>
928 return *
static_cast<BinaryVariableLengthFieldType*
>(binary_);
937 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
939 assert(headSize <= size_);
950 if ONIXS_B3_BOE_UNLIKELY(empty() || (size_ < BinaryVariableLengthFieldType::Size))
952 throwBadBinaryBlock();
955 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
957 if ONIXS_B3_BOE_UNLIKELY(headSize > size_)
959 throwBadBinaryBlock();
973 template <
class BinarySize>
998 return Group(binary_, size_, version_);
1007 const BinarySize headSize = head<Group>().binarySize();
1009 assert(headSize <= size_);
1011 return SbeGroupList(advanceByBytes(binary_, headSize), size_ - headSize, version_);
1020 const BinarySize headSize = head<Group>().binarySize();
1022 assert(headSize <= size_);
1033 const BinarySize headSize = checkHead<Group>();
1035 return SbeGroupList(advanceByBytes(binary_, headSize), size_ - headSize, version_);
1044 const BinarySize headSize = checkHead<Group>();
1050 template<
class Group>
1051 BinarySize checkHead()
const 1053 if ONIXS_B3_BOE_UNLIKELY(size_ < Group::Dimension::Size)
1055 throwBadBinaryBlock();
1058 const Group group = head<Group>();
1060 const BinarySize headSize = group.binarySize();
1062 if ONIXS_B3_BOE_UNLIKELY(headSize > size_)
1064 throwBadBinaryBlock();
1069 const BinarySize entrySize = group.entrySize();
1070 const BinarySize expectedEntrySize = Group::Entry::minimalBlockLength(version_);
1072 if ONIXS_B3_BOE_UNLIKELY(entrySize < expectedEntrySize)
1074 throwBadBinaryBlock();
1087 template<
typename Traits>
1090 if ONIXS_B3_BOE_UNLIKELY(version < Traits::MinimalVersion)
1092 throwBadMessageVersion(version, Traits::MinimalVersion);
1097 template<
typename Traits>
1100 checkVersion<Traits>(version);
1102 if ONIXS_B3_BOE_UNLIKELY(version < since)
1104 throwBadMessageVersion(version, since);
1109 template<
typename Traits>
1112 if ONIXS_B3_BOE_UNLIKELY(
id != Traits::Id)
1114 throwBadSchemaId(Traits::Id,
id);
1119 template<
typename Traits>
1122 checkSchemaId<Traits>(id);
1123 checkVersion<Traits>(version);
1157 if ONIXS_B3_BOE_UNLIKELY(size < MessageHeader::Size)
1158 throwBinaryBlockIsTooSmall(size, MessageHeader::Size);
1160 this->version(version);
1172 if ONIXS_B3_BOE_UNLIKELY(size < MessageHeader::Size)
1173 throwBinaryBlockIsTooSmall(size, MessageHeader::Size);
1176 if ONIXS_B3_BOE_UNLIKELY(size < (MessageHeader::Size + header_->blockLength()))
1177 throwBinaryBlockIsTooSmall(size, MessageHeader::Size + header_->blockLength());
1191 assert(size >= MessageHeader::Size);
1192 assert(size >= MessageHeader::Size + header_->blockLength());
1213 return header_->templateId();
1221 return header_->version();
1229 return header_->schemaId();
1253 return advanceByBytes(header_, size_);
1261 return advanceByBytes(header_, size_);
1275 return advanceByBytes(header_, MessageHeader::Size);
1283 return header_->blockLength();
1291 return advanceByBytes(header_, MessageHeader::Size);
1299 return advanceByBytes(header_, MessageHeader::Size);
1311 header_->setVersion(version);
1322 void* list = advanceByBytes<void>(body(), blockLength());
1324 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1326 return GroupList(list, listSize, header_->version());
1335 const void* list = advanceByBytes(block(), blockLength());
1337 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1339 return GroupList(const_cast<void*>(list), listSize, header_->version());
1343 template<
typename Group>
1347 assert(group.valid());
1348 group.init(entrySize);
1352 template<
typename Group>
1354 void setupGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1356 assert(messageTail);
1357 assert(group.valid());
1358 group.setup(entryCount, messageTail, blockEnd());
1362 template<
typename Group>
1364 void constructGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1366 assert(messageTail);
1367 assert(group.valid());
1368 group.construct(entryCount, messageTail, blockEnd());
1372 template<
typename DATA>
1375 assert(oldMessageTail);
1377 const ptrdiff_t lengthChange =
static_cast<ptrdiff_t
>(value.length() - data.length());
1379 const void*
const newMessageTail = advanceByBytes(oldMessageTail, lengthChange);
1381 if ONIXS_B3_BOE_UNLIKELY(byteDistance(blockEnd(), newMessageTail) < 0)
1382 throwNotEnoughSpace();
1384 const void*
const oldEndOfData = advanceByBytes(data.varData().data(), data.varData().size());
1386 void*
const newEndOfData = toOpaquePtr(advanceByBytes(&data, value.length() + DATA::Size));
1388 std::memmove(newEndOfData, oldEndOfData, byteDistance(oldMessageTail, oldEndOfData));
1390 data.varData(value);
1402 void* list = advanceByBytes<void>(body(), blockLength());
1404 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1406 return VariableLengthFieldList(list, listSize, header_->version());
1415 const void* list = advanceByBytes(block(), blockLength());
1417 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1419 return VariableLengthFieldList(const_cast<void*>(list), listSize, header_->version());
1430 assert(blockLength >= minimalBlockLength);
1432 header_->setTemplateId(value);
1433 header_->setBlockLength(blockLength);
1434 header_->setSchemaId(
id);
1436 zeroPaddingBytes(minimalBlockLength);
1444 const ptrdiff_t distance = byteDistance(tail, binary());
1446 assert(distance > 0);
1448 assert(distance <= (std::numeric_limits<MessageSize>::max)());
1452 assert(size <= size_);
1458 template<
class Callable,
class Owner>
1461 setVarDataField(callable(owner), value, owner.tail());
1465 template<
class Callable,
class Owner>
1468 if ONIXS_B3_BOE_UNLIKELY(since > version())
1469 throwDisallowedField();
1471 setVariableLengthField(callable, value, owner);
1475 template<
class Callable,
class Owner>
1478 ONIXS_B3_BOE_CHECK_NOTHROW(callable(owner));
1479 return callable(owner).varData();
1483 template<
class Callable,
class Owner>
1486 if ONIXS_B3_BOE_UNLIKELY(since > version())
1489 return getVariableLengthField(callable, owner);
1493 template<
class Callable,
class Owner>
1496 ONIXS_B3_BOE_CHECK_NOTHROW(callable(owner));
1497 callable(owner).length(0);
1501 template<
class Group,
class Callable,
class Owner>
1504 const typename Group::EntrySize entrySize = Group::Entry::blockLength(version());
1506 Group grp = callable(owner);
1508 initGroup(grp, entrySize);
1512 template<
class Callable,
class Owner>
1515 if ONIXS_B3_BOE_UNLIKELY(since > version())
1518 setVariableLengthFieldToNull(callable, owner);
1522 template<
class Group,
class Callable,
class Owner>
1525 if ONIXS_B3_BOE_UNLIKELY(since > version())
1528 resetGroup<Group>(callable, owner);
1532 template<
class Group,
class Callable,
class Owner>
1535 ONIXS_B3_BOE_CHECK_NOTHROW(callable(owner));
1536 return callable(owner);
1540 template<
class Group,
class Callable,
class Owner>
1543 if ONIXS_B3_BOE_UNLIKELY(since > version())
1546 return getGroup<Group>(callable, owner);
1550 template<
class Group,
class Callable,
class Owner>
1553 if ONIXS_B3_BOE_UNLIKELY(since > version())
1556 return constructGroup<Group>(callable, length, owner);
1560 template<
class Group,
class Callable,
class Owner>
1563 Group group = callable(owner);
1565 constructGroup(group, length, owner.tail());
1571 template<
class Group,
class Callable,
class Owner>
1574 if ONIXS_B3_BOE_UNLIKELY(since > version())
1577 return setupGroup<Group>(callable, length, owner);
1581 template<
class Group,
class Callable,
class Owner>
1582 Group
setupGroup(Callable callable,
typename Group::Size length, Owner& owner)
1584 Group group = callable(owner);
1586 setupGroup(group, length, owner.tail());
SbeGroupEntries() noexcept
Initializes a blank instance referencing to nothing.
StrRef fixedStr(BlockLength offset) const noexcept
Provides access to a string field value.
void * encoded() const noexcept
EntrySize entrySize() const noexcept
#define ONIXS_B3_BOE_MESSAGING_NAMESPACE_END
Operations over SBE-encoded repeating group entries.
Operations over a repeating group instance.
MessageSize calculateBinarySize(const void *tail) const noexcept
SbeGroupEntries(void *encoded, BlockLength blockLength, Size groupSize, SchemaVersion version) noexcept
Initializes the instance referencing to data.
bool empty() const noexcept
bool decimal(Value &value, BlockLength offset, NullValue null) const noexcept
const void * encoded() const noexcept
SbeGroupList tail() const noexcept
BodySizeType BlockLength
Type to present the length of binary data of the repeating group entry.
#define ONIXS_B3_BOE_NULLPTR
SbeVariableLengthFieldList< MessageSize > VariableLengthFieldList
Binary group list instantiation.
Value ordinary(BlockLength offset) const noexcept
SchemaVersion version() const noexcept
BinarySize binarySize() const noexcept
Enumeration::Enum enumeration(BlockLength offset) const noexcept
void setVariableLengthFieldToNull(Callable callable, SchemaVersion since, Owner &owner) noexcept
Sets the variable length field to null.
bool ordinary(Value &value, BlockLength offset, NullValue null) const noexcept
Provides access to an optional field value.
SbeGroupList(void *binary, BinarySize size, SchemaVersion version) noexcept
Initializes the list over the memory block.
Size size() const noexcept
MessageSize BlockLength
Length of the message body representing a block of fixed-length fields.
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
#define ONIXS_B3_BOE_NOTHROW
Group getGroup(Callable callable, SchemaVersion since, Owner &owner) const noexcept
TimeSpan operator-(const TimeSpan &timeSpan) noexcept
Changes the sign of the Timestamp.
BinaryVariableLengthFieldType & head() const noexcept
#define ONIXS_B3_BOE_HOTPATH
bool valid() const noexcept
Group getGroup(Callable callable, Owner &owner) const noexcept
Value decimal(BlockLength offset) const noexcept
SbeMessage(void *data, MessageSize size, NoCheck) noexcept
Initializes the instance over the given memory block.
void init(MessageHeader::TemplateId value, MessageHeader::BlockLength minimalBlockLength, MessageHeader::BlockLength blockLength, SchemaId id) noexcept
SBE-encoded repeating group.
SchemaVersion version() const noexcept
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan) noexcept
Adds the time interval.
SbeVariableLengthFieldList tail() const noexcept
bool empty() const noexcept
void checkSchema(SchemaId id, SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
bool fixedStr(StrRef &value, BlockLength offset, SchemaVersion since) const noexcept
Provides access to an optional string field value.
SbeGroup() noexcept
Initializes a blank instance referencing to nothing.
MessageTemplateId templateId() const noexcept
GroupSizeType BinarySize
Length of group data.
SbeVariableLengthFieldList< BinarySize > checkVariableLengthFields() const
Checks the variable length fields list consistency.
SbeMessage(void *data, MessageSize size)
Initializes the instance over the given memory block.
Entries entries() const noexcept
const void * block() const noexcept
SbeGroupEntry()
Initializes a blank instance.
void setOrdinary(BlockLength offset, FieldValue value) noexcept
Sets the field value.
#define ONIXS_B3_BOE_CONSTEXPR
void resetGroup(Callable callable, Owner &owner) noexcept
Sets the group to the initial state.
Container & container() noexcept
void checkVersion(SchemaVersion since, SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
UInt16 MessageSize
Message length type.
bool decimal(Value &value, BlockLength offset, NullValue null, SchemaVersion since) const noexcept
bool valid() const noexcept
Iterator end() const noexcept
Group setupGroup(Callable callable, typename Group::Size length, Owner &owner)
Setups the repeating group with the given number of entries.
const void * encoded() const noexcept
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...
Value & accessOrdinary(BlockLength offset) noexcept
#define ONIXS_B3_BOE_NODISCARD
static constexpr MessageSize getMaxMessageSize() noexcept
Maximal message size.
SchemaId schemaId() const noexcept
EncodedLength encodedLength() const noexcept
DimensionType Dimension
Repeating group dimension type.
SbeVariableLengthFieldList checkTail() const
Checks the variable-length field list consistency.
const void * tail() const noexcept
SbeMessage() noexcept
Initializes a blank instance.
Iterator() noexcept
Initializes the instance that refers to nothing.
Iterator(void *entry, EncodedLength size, SchemaVersion version) noexcept
Initializes the instance to the given repeating group.
SbeGroup(void *data, BinarySize size, SchemaVersion version) noexcept
Initializes an instance referencing to a valid group of a given message.
MessageSize bufferSize() const noexcept
bool enumeration(typename Enumeration::Enum &value, BlockLength offset, NullValue null, SchemaVersion since) const noexcept
Provides access to an optional field value.
Entries::Size Size
Number of entries in the group.
void setVariableLengthField(Callable callable, StrRef value, SchemaVersion since, Owner &owner)
Sets the value of the variable length field.
constexpr UInt16 MaxB3BOEMessageSize
Maximum supported message size.
std::random_access_iterator_tag iterator_category
void clear() noexcept
Blank the instance.
#define ONIXS_B3_BOE_MESSAGING_NAMESPACE_BEGIN
void constructGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header, sets all optional fields to null.
Group head() const noexcept
SbeGroupList< MessageSize > GroupList
Binary group list instantiation.
Variable-length fields list.
StrRef getVariableLengthField(Callable callable, SchemaVersion since, Owner &owner) const noexcept
SbeGroupEntries< EntryType, typename Dimension::BlockLength, typename Dimension::NumInGroup, GroupSizeType > Entries
Binary group blocks.
VariableLengthFieldList variableLengthFields() noexcept
VariableLengthFieldList variableLengthFields() const noexcept
#define ONIXS_B3_BOE_LTWT_CLASS
BlockLength blockLength() const noexcept
Iterator begin() const noexcept
SbeGroupEntry(void *encoded, BlockLength size, SchemaVersion version)
Initializes the instance from the memory block of the encoded message.
const void * binary() const noexcept
NumInGroup Size
Number of entries in the collection.
bool valid() const noexcept
Group setupGroup(Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
Setups the repeating group with the given number of entries.
Length EncodedLength
The length of the binary data occupied by the group entries.
std::basic_string_view< Char > StrRef
Entries::Entry Entry
Group entry type.
GroupList groups() const noexcept
void setVariableLengthField(Callable callable, StrRef value, Owner &owner)
Sets the value of the variable length field.
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...
void checkSchemaId(SchemaId id)
Checks the compatibility with the provided SBE Schema ID.
void setupGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header.
SbeMessage(void *data, MessageSize size, SchemaVersion version)
Initializes the instance over the given memory block.
bool empty() const noexcept
Size size() const noexcept
const void * blockEnd() noexcept
#define ONIXS_B3_BOE_DEFAULT
SbeVariableLengthFieldList(void *binary, BinarySize size, SchemaVersion version) noexcept
Initializes the list over the given memory block.
SbeGroupEntries(const SbeGroupEntries< OtherEntry, OtherBlockLength, OtherNumInGroup, OtherLength > &other) noexcept
Copy constructor.
char Char
Character type alias.
bool ordinary(Value &value, BlockLength offset, NullValue null, SchemaVersion since) const noexcept
Provides access to an optional field value.
An iterator over SBE-encoded group entries.
MessageSize EncodedLength
Length of the message binary data.
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...
SbeGroupList checkTail() const
Checks the list consistency.
void setFixedStr(BlockLength offset, StrRef value) noexcept
Sets the field value.
void resetGroup(Callable callable, SchemaVersion since, Owner &owner)
Resets the repeating group.
const Value & accessOrdinary(BlockLength offset) const noexcept
Base services to access fields stored in an SBE-encoded block of memory.
bool valid() const noexcept
void setVarDataField(DATA &data, StrRef value, const void *oldMessageTail)
Sets the variable length field value.
ptrdiff_t difference_type
void setOrdinary(BlockLength offset, FieldValue value, SchemaVersion since)
Sets the field value.
void setFixedStr(BlockLength offset, StrRef value, SchemaVersion since)
Sets the field value.
MessageHeader::SchemaId SchemaId
#define ONIXS_B3_BOE_LTWT_EXPORTED
DimensionType::BlockLength EntrySize
Length of group entry data.
bool enumeration(typename Enumeration::Enum &value, BlockLength offset, NullValue null) const noexcept
Provides access to an optional field value.
void setEnumeration(BlockLength offset, typename Enumeration::Enum value, SchemaVersion since)
Sets the field value.
void * binary() const noexcept
bool empty() const noexcept
bool valid() const noexcept
void setEnumeration(BlockLength offset, typename Enumeration::Enum value) noexcept
Sets the field value.
bool fixedStr(StrRef &value, BlockLength offset) const noexcept
Provides access to an optional string field value.
GroupList groups() noexcept
SbeVariableLengthFieldList< BinarySize > variableLengthFields() const noexcept
Entries::Iterator Iterator
The iterator type for group entries.
EntryType Entry
The type of the repeating group entry.
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
const void * block() const noexcept
Services to access fields stored in an SBE-encoded block of fixed-length fields.
SbeMessage & version(SchemaVersion version) noexcept
Sets the SBE Schema version.
StrRef getVariableLengthField(Callable callable, const Owner &owner) const noexcept
void initGroup(Group &group, typename Group::EntrySize entrySize) noexcept
Resets the group to the initial state.
Iterator end() const
Returns the iterator pointing to the entry behind the end of the group.
BlockLength blockLength() const noexcept
void setVariableLengthFieldToNull(Callable callable, Owner &owner) noexcept
Resets the variable length field.
void * encoded() noexcept
#define ONIXS_B3_BOE_UNUSED
const void * blockEnd() const noexcept