43 template<
typename Message>
inline 46 if ONIXS_B3_UMDF_MD_UNLIKELY(length < minimalRequiredLength)
47 throwBinaryBlockIsTooSmall(length, minimalRequiredLength, Message::className());
62 template < class Container, class BlockLength >
68 return *static_cast <
const Container*> (
this);
78 template < class Value > ONIXS_B3_UMDF_MD_HOTPATH
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 template <
class Value,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
95 value = ordinary<Value>(offset);
97 return (null != value);
104 template <
class Value,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
107 return (since <= container().version() && ordinary (value, offset, null ) );
111 template <
class Enumeration > ONIXS_B3_UMDF_MD_HOTPATH
114 typedef typename Enumeration::Base Base;
115 typedef typename Enumeration::Enum Enum;
117 return static_cast<Enum
>(ordinary<Base>(offset));
121 template <
class Enumeration,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
124 typedef typename Enumeration::Base Base;
125 typedef typename Enumeration::Enum Enum;
127 value = static_cast <Enum>(ordinary<Base>(offset));
128 return null != value;
132 template <
class Enumeration,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
135 return (since <= container().version() && enumeration<Enumeration>(value, offset, null) );
139 template <
class Value > ONIXS_B3_UMDF_MD_HOTPATH
142 return ordinary<Value>(offset);
149 template <
class Value,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
152 value = ordinary<Value>(offset);
153 return null != value;
160 template <
class Value,
class NullValue > ONIXS_B3_UMDF_MD_HOTPATH
163 return (since <= container().version() && decimal(value, offset, null));
167 template < BlockLength Length > ONIXS_B3_UMDF_MD_HOTPATH
170 assert(container().blockLength() >= (offset + Length) &&
"The requested field exceeds provided block boundaries.");
172 const Char*
const text = reinterpret_cast <
const Char*> (advanceByBytes(container().block(), offset));
174 return StrRef(text, strnlen(text, Length));
181 template<BlockLength Length> ONIXS_B3_UMDF_MD_HOTPATH
184 value = fixedStr<Length>(offset);
185 return !value.empty();
192 template<BlockLength Length> ONIXS_B3_UMDF_MD_HOTPATH
195 return (since <= container().version() && fixedStr<Length>(value, offset));
203 template <
class Container,
class BlockLength >
210 return *
static_cast<Container*
>(
this);
214 ONIXS_B3_UMDF_MD_HOTPATH
217 const BlockLength encodedBlockLength = container().blockLength();
219 assert(encodedBlockLength >= offset);
221 const size_t paddingLength = encodedBlockLength - offset;
222 std::memset(advanceByBytes(container().block(), offset), 0, paddingLength);
226 template<
class FieldValue> ONIXS_B3_UMDF_MD_HOTPATH
229 assert(container().blockLength() >= (offset + size<FieldValue>()) &&
"The requested field exceeds provided block boundaries.");
231 void*
const fieldPos = advanceByBytes(container().block(), offset);
232 setValue(fieldPos, value);
236 template<
class FieldValue> ONIXS_B3_UMDF_MD_HOTPATH
239 if ONIXS_B3_UMDF_MD_UNLIKELY(since > container().version())
240 throwDisallowedField();
242 setOrdinary(offset, value);
246 template<
class Enumeration> ONIXS_B3_UMDF_MD_HOTPATH
249 typedef typename Enumeration::Base Base;
250 setOrdinary<Base>(offset,
static_cast<Base
>(value));
254 template<
class Enumeration> ONIXS_B3_UMDF_MD_HOTPATH
257 typedef typename Enumeration::Base Base;
258 setOrdinary(offset, static_cast<Base>(value), since);
262 template<BlockLength Size> ONIXS_B3_UMDF_MD_HOTPATH
265 assert(container().blockLength() >= (offset + Size) &&
"The requested field exceeds provided block boundaries.");
266 assert(value.size() <= Size &&
"The string is truncated.");
268 void*
const fieldPos = advanceByBytes(container().block(), offset);
269 const size_t sizeToCopy = (std::min)(Size, static_cast<BlockLength>(value.size()));
272 std::memcpy(fieldPos, value.data(), sizeToCopy);
274 std::memset(advanceByBytes(fieldPos, sizeToCopy), 0, Size - sizeToCopy);
278 template<BlockLength Size> ONIXS_B3_UMDF_MD_HOTPATH
281 if ONIXS_B3_UMDF_MD_UNLIKELY(since > container().version())
282 throwDisallowedField();
284 setFixedStr<Size>(offset, value);
295 template <class BodySizeType>
311 ONIXS_B3_UMDF_MD_HOTPATH
371 const void* encoded_;
377 template <
class EntryType,
class BlockLength,
class NumInGroup,
class Length >
413 ONIXS_B3_UMDF_MD_HOTPATH
429 ONIXS_B3_UMDF_MD_HOTPATH
434 return Entry(entry_, size_, version_);
438 Entry operator *()
const 446 return entry_ == other.entry_;
452 return entry_ != other.entry_;
458 return entry_ < other.entry_;
464 return entry_ > other.entry_;
472 entry_ = advanceByBytes(entry_, size_);
482 entry_ = advanceBackByBytes(entry_, size_);
488 ONIXS_B3_UMDF_MD_HOTPATH
493 return Iterator(advanceByBytes(entry_, distance * size_), size_, version_);
497 ONIXS_B3_UMDF_MD_HOTPATH
502 return Iterator(advanceBackByBytes(entry_, distance * size_), size_, version_);
523 , blockLength_(blockLength)
528 assert(blockLength > 0);
529 assert(version != 0);
553 return Iterator(encoded(), blockLength_, version_);
559 return Iterator(advanceByBytes(encoded(), encodedLength()), blockLength_, version_);
565 Entry operator [](Size index)
const 567 assert(index < size_);
570 return Entry(advanceByBytes(encoded_, static_cast<ptrdiff_t>(index) * blockLength_), blockLength_, version_);
582 return (static_cast<EncodedLength>(blockLength_) * static_cast<EncodedLength>(size_) );
586 template<
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength >
588 : encoded_(other.encoded_)
589 , blockLength_(other.blockLength_)
591 , version_(other.version_)
596 assert(blockLength_ == other.blockLength_);
597 assert(size_ == other.size_);
600 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
603 encoded_ = other.encoded_;
605 blockLength_ = other.blockLength_;
607 assert(blockLength_ == other.blockLength_);
611 assert(size_ == other.size_);
613 version_ = other.version_;
620 template <
class OtherEntry,
class OtherBlockLength,
class OtherNumInGroup,
class OtherLength>
friend class SbeGroupEntries;
623 BlockLength blockLength_;
629 template <
class EntryType,
class DimensionType,
class GroupSizeType >
640 enum { EmptySize = Dimension::Size };
661 , entries_(ONIXS_B3_UMDF_MD_NULLPTR)
667 ONIXS_B3_UMDF_MD_HOTPATH
669 : header_(static_cast <Dimension*>(data))
670 , entries_(advanceByBytes(data, Dimension::Size))
695 ONIXS_B3_UMDF_MD_HOTPATH
701 const Dimension*
const group =
static_cast<const Dimension*
>(header_);
703 return group->numInGroup();
707 ONIXS_B3_UMDF_MD_HOTPATH
712 return Iterator(entries_, numericCast<Size>(entrySize()), version_);
716 ONIXS_B3_UMDF_MD_HOTPATH
721 return Iterator(advanceByBytes(binary(), binarySize()), numericCast<Size>(entrySize()), version_);
727 ONIXS_B3_UMDF_MD_HOTPATH
728 Entry operator [](Size index)
const 731 assert(index < size());
733 return Entry(advanceByBytes(entries_, static_cast<ptrdiff_t>(index) * entrySize()), entrySize(), version_);
737 ONIXS_B3_UMDF_MD_NODISCARD
743 return Entries (entries_, header_->blockLength(), header_->numInGroup(), version_);
755 return advanceByBytes(toByteBlock(encoded()), binarySize());
759 ONIXS_B3_UMDF_MD_HOTPATH
766 ONIXS_B3_UMDF_MD_HOTPATH
769 return Dimension::Size + (
static_cast<BinarySize
>(entrySize()) * static_cast<BinarySize>(size()));
773 ONIXS_B3_UMDF_MD_HOTPATH
779 Dimension*
const group =
static_cast<Dimension*
>(header_);
780 return group->blockLength();
790 Dimension*
const group =
static_cast<Dimension*
>(header_);
791 group->setBlockLength(entrySize);
792 group->setNumInGroup(0);
796 Size allocate(Size entryCount,
const void* messageTail,
const void* blockEnd)
802 Dimension*
const group =
static_cast<Dimension*
>(header_);
804 const EntrySize entrySize = group->blockLength();
806 if ONIXS_B3_UMDF_MD_UNLIKELY(
807 entrySize < EntryType::blockLength(version_))
809 throwBadBinaryBlock();
812 const Size oldEntryCount = group->numInGroup();
814 if(oldEntryCount == entryCount)
817 const ptrdiff_t memShift =
818 (entryCount - oldEntryCount) * static_cast<ptrdiff_t>(entrySize);
820 const void*
const newMessageTail =
821 advanceByBytes(messageTail, memShift);
823 if ONIXS_B3_UMDF_MD_UNLIKELY(byteDistance(blockEnd, newMessageTail) < 0)
824 throwNotEnoughSpace();
826 const void*
const oldEndOfGroup =
827 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * oldEntryCount);
829 void*
const newEndGroup =
830 advanceByBytes(entries_, static_cast<ptrdiff_t>(entrySize) * entryCount);
835 byteDistance(messageTail, oldEndOfGroup));
837 group->setNumInGroup(entryCount);
839 return oldEntryCount;
843 ONIXS_B3_UMDF_MD_HOTPATH
844 void setup(Size entryCount,
const void* messageTail,
const void* blockEnd)
850 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
852 for(Size index = oldEntryCount; index < entryCount; ++index)
853 zeroPaddingBytes((*
this)[index].resetVariableFields());
857 ONIXS_B3_UMDF_MD_HOTPATH
858 void construct(Size entryCount,
const void* messageTail,
const void* blockEnd)
864 const Size oldEntryCount = allocate(entryCount, messageTail, blockEnd);
866 for(Size index = oldEntryCount; index < entryCount; ++index)
867 zeroPaddingBytes((*
this)[index].reset());
870 ONIXS_B3_UMDF_MD_HOTPATH
871 static void zeroPaddingBytes(Entry& entry)
873 assert(entry.valid());
874 entry.zeroPaddingBytes(EntryType::minimalBlockLength(entry.version()));
886 template <
class BinarySize >
891 ONIXS_B3_UMDF_MD_HOTPATH
906 template<
class BinaryVariableLengthFieldType>
909 return *
static_cast<BinaryVariableLengthFieldType*
>(binary_);
913 template<
class BinaryVariableLengthFieldType> ONIXS_B3_UMDF_MD_HOTPATH
918 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
920 assert(headSize <= size_);
928 template<
class BinaryVariableLengthFieldType> ONIXS_B3_UMDF_MD_HOTPATH
931 if ONIXS_B3_UMDF_MD_UNLIKELY(empty() || (size_ < BinaryVariableLengthFieldType::Size))
933 throwBadBinaryBlock();
936 const BinarySize headSize = head<BinaryVariableLengthFieldType>().binarySize();
938 if ONIXS_B3_UMDF_MD_UNLIKELY(headSize > size_)
940 throwBadBinaryBlock();
954 template <
class BinarySize>
959 ONIXS_B3_UMDF_MD_HOTPATH
974 template<
class Group> ONIXS_B3_UMDF_MD_HOTPATH
979 return Group(binary_, size_, version_);
983 template<
class Group> ONIXS_B3_UMDF_MD_HOTPATH
988 const BinarySize headSize = head<Group>().binarySize();
990 assert(headSize <= size_);
992 return SbeGroupList(advanceByBytes(binary_, headSize), size_ - headSize, version_);
996 template <
class Group> ONIXS_B3_UMDF_MD_HOTPATH
1001 const BinarySize headSize = head<Group>().binarySize();
1003 assert(headSize <= size_);
1011 template<
class Group> ONIXS_B3_UMDF_MD_HOTPATH
1014 const BinarySize headSize = checkHead<Group>();
1016 return SbeGroupList(advanceByBytes(binary_, headSize), size_ - headSize, version_);
1022 template <
class Group> ONIXS_B3_UMDF_MD_HOTPATH
1025 const BinarySize headSize = checkHead<Group>();
1031 template<
class Group>
1032 BinarySize checkHead()
const 1034 if ONIXS_B3_UMDF_MD_UNLIKELY(size_ < Group::Dimension::Size)
1036 throwBadBinaryBlock();
1039 const Group group = head<Group>();
1041 const BinarySize headSize = group.binarySize();
1043 if ONIXS_B3_UMDF_MD_UNLIKELY(headSize > size_)
1045 throwBadBinaryBlock();
1050 const BinarySize entrySize = group.entrySize();
1051 const BinarySize expectedEntrySize = Group::Entry::minimalBlockLength(version_);
1053 if ONIXS_B3_UMDF_MD_UNLIKELY(entrySize < expectedEntrySize)
1055 throwBadBinaryBlock();
1068 template<
typename Traits>
1071 if ONIXS_B3_UMDF_MD_UNLIKELY(version < Traits::MinimalVersion)
1073 throwBadMessageVersion(version, Traits::MinimalVersion);
1078 template<
typename Traits>
1081 checkVersion<Traits>(version);
1083 if ONIXS_B3_UMDF_MD_UNLIKELY(version < since)
1085 throwBadMessageVersion(version, since);
1090 template<
typename Traits>
1093 if ONIXS_B3_UMDF_MD_UNLIKELY(
id != Traits::Id)
1095 throwBadSchemaId(Traits::Id,
id);
1100 template<
typename Traits>
1103 checkSchemaId<Traits>(id);
1104 checkVersion<Traits>(version);
1145 ONIXS_B3_UMDF_MD_HOTPATH
1153 if ONIXS_B3_UMDF_MD_UNLIKELY(size < MessageHeader::Size)
1154 throwBinaryBlockIsTooSmall(size, MessageHeader::Size);
1157 if ONIXS_B3_UMDF_MD_UNLIKELY(size < (MessageHeader::Size + header_->blockLength()))
1158 throwBinaryBlockIsTooSmall(size, MessageHeader::Size + header_->blockLength());
1164 ONIXS_B3_UMDF_MD_HOTPATH
1172 assert(size >= MessageHeader::Size);
1173 assert(size >= MessageHeader::Size + header_->blockLength());
1194 return header_->templateId();
1202 return header_->version();
1210 return header_->schemaId();
1234 return advanceByBytes(header_, size_);
1242 return advanceByBytes(header_, size_);
1264 return header_->blockLength();
1272 return advanceByBytes(header_, MessageHeader::Size);
1311 ONIXS_B3_UMDF_MD_HOTPATH
1316 const void* list = advanceByBytes(block(), blockLength());
1318 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1320 return GroupList(const_cast<void*>(list), listSize, header_->version());
1324 template<
typename Group>
1325 ONIXS_B3_UMDF_MD_HOTPATH
1328 assert(group.valid());
1329 group.init(entrySize);
1333 template<
typename Group>
1334 ONIXS_B3_UMDF_MD_HOTPATH
1335 void setupGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1337 assert(messageTail);
1338 assert(group.valid());
1339 group.setup(entryCount, messageTail, blockEnd());
1343 template<
typename Group>
1344 ONIXS_B3_UMDF_MD_HOTPATH
1345 void constructGroup(Group& group,
typename Group::Size entryCount,
const void* messageTail)
1347 assert(messageTail);
1348 assert(group.valid());
1349 group.construct(entryCount, messageTail, blockEnd());
1390 ONIXS_B3_UMDF_MD_HOTPATH
1395 const void* list = advanceByBytes(block(), blockLength());
1397 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1399 return VariableLengthFieldList(const_cast<void*>(list), listSize, header_->version());
1419 ONIXS_B3_UMDF_MD_HOTPATH
1424 const ptrdiff_t distance = byteDistance(tail, binary());
1426 assert(distance > 0);
1428 assert(distance <= (std::numeric_limits<MessageSize>::max)());
1432 assert(size <= size_);
1438 template<
class Callable,
class Owner>
1441 setVarDataField(callable(owner), value, owner.tail());
1445 template<
class Callable,
class Owner>
1448 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1449 throwDisallowedField();
1451 setVariableLengthField(callable, value, owner);
1455 template<
class Callable,
class Owner>
1459 return callable(owner).varData();
1463 template<
class Callable,
class Owner>
1466 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1469 return getVariableLengthField(callable, owner);
1473 template<
class Callable,
class Owner>
1477 callable(owner).length(0);
1481 template<
class Group,
class Callable,
class Owner>
1484 const typename Group::EntrySize entrySize = Group::Entry::blockLength(version());
1486 Group grp = callable(owner);
1488 initGroup(grp, entrySize);
1492 template<
class Callable,
class Owner>
1495 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1498 setVariableLengthFieldToNull(callable, owner);
1502 template<
class Group,
class Callable,
class Owner>
1505 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1508 resetGroup<Group>(callable, owner);
1512 template<
class Group,
class Callable,
class Owner>
1516 return callable(owner);
1520 template<
class Group,
class Callable,
class Owner>
1523 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1526 return getGroup<Group>(callable, owner);
1530 template<
class Group,
class Callable,
class Owner>
1533 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1536 return constructGroup<Group>(callable, length, owner);
1540 template<
class Group,
class Callable,
class Owner>
1543 Group group = callable(owner);
1545 constructGroup(group, length, owner.tail());
1551 template<
class Group,
class Callable,
class Owner>
1554 if ONIXS_B3_UMDF_MD_UNLIKELY(since > version())
1557 return setupGroup<Group>(callable, length, owner);
1561 template<
class Group,
class Callable,
class Owner>
1562 Group
setupGroup(Callable callable,
typename Group::Size length, Owner& owner)
1564 Group group = callable(owner);
1566 setupGroup(group, length, owner.tail());
1573 ONIXS_B3_UMDF_MD_NODISCARD
ONIXS_B3_UMDF_MD_HOTPATH void setOrdinary(BlockLength offset, FieldValue value)
Sets the field value.
ONIXS_B3_UMDF_MD_HOTPATH StrRef fixedStr(BlockLength offset) const
Provides access to a string field value.
ONIXS_B3_UMDF_MD_HOTPATH bool enumeration(typename Enumeration::Enum &value, BlockLength offset, NullValue null, SchemaVersion since) const
Provides access to an optional field value.
ONIXS_B3_UMDF_MD_HOTPATH bool fixedStr(StrRef &value, BlockLength offset) const
Provides access to an optional string field value.
DimensionType Dimension
Repeating group dimension type.
const void * binary() const
BodySizeType BlockLength
Type to present the length of binary data of the repeating group entry.
ONIXS_B3_UMDF_MD_HOTPATH Group head() const
DimensionType::BlockLength EntrySize
Length of group entry data.
Iterator end() const
Returns the iterator pointing to the entry behind the end of the group.
SbeGroupList< MessageSize > GroupList
Binary group list instantiation.
#define ONIXS_B3_UMDF_MD_DEFAULT
bool operator!=(const TimeSpan &left, const TimeSpan &right)
Compares with other instance for in-equality.
MessageTemplateId templateId() const
ONIXS_B3_UMDF_MD_HOTPATH Iterator(void *entry, Size size, SchemaVersion version)
Initializes the instance to the given repeating group.
SbeGroupEntries(const SbeGroupEntries< OtherEntry, OtherBlockLength, OtherNumInGroup, OtherLength > &other)
Copy constructor.
ONIXS_B3_UMDF_MD_HOTPATH Enumeration::Enum enumeration(BlockLength offset) const
#define ONIXS_B3_UMDF_MD_NOTHROW
#define ONIXS_B3_UMDF_MD_CONSTEXPR
ONIXS_B3_UMDF_MD_HOTPATH SbeGroupList tail() const
ONIXS_B3_UMDF_MD_HOTPATH SbeMessage(void *data, MessageSize size, NoCheck)
Initializes the instance over the given memory block.
MessageSize EncodedLength
Length of the message binary data.
GroupSizeType BinarySize
Length of group data.
std::random_access_iterator_tag iterator_category
void setVariableLengthFieldToNull(Callable callable, Owner &owner)
Resets the variable length field.
const void * tail() const
void resetGroup(Callable callable, SchemaVersion since, Owner &owner)
Resets the repeating group.
Services to access fields stored in an SBE-encoded block of fixed-length fields.
#define ONIXS_B3_UMDF_MD_NULLPTR
MessageSize bufferSize() const
SchemaVersion version() const
const void * blockEnd() const
const void * encoded() const
ONIXS_B3_UMDF_MD_HOTPATH EntrySize entrySize() const
ONIXS_B3_UMDF_MD_HOTPATH void setOrdinary(BlockLength offset, FieldValue value, SchemaVersion since)
Sets the field value.
#define ONIXS_B3_UMDF_MD_ASSERT(CHECK)
ONIXS_B3_UMDF_MD_HOTPATH Iterator end() const
SbeGroupEntry()
Initializes a blank instance.
Operations over a repeating group instance.
SbeMessage()
Initializes a blank instance.
Entries::Entry Entry
Group entry type.
Type of the Market Data Entry.
Group setupGroup(Callable callable, typename Group::Size length, Owner &owner)
Setups the repeating group with the given number of entries.
ONIXS_B3_UMDF_MD_HOTPATH bool ordinary(Value &value, BlockLength offset, NullValue null) const
Provides access to an optional field value.
BlockLength blockLength() const
bool operator<(const TimeSpan &left, const TimeSpan &right)
Checks whether left time interval less than right one.
ONIXS_B3_UMDF_MD_HOTPATH void setupGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header.
ONIXS_B3_UMDF_MD_HOTPATH Value decimal(BlockLength offset) const
SBE-encoded repeating group.
bool operator>(const TimeSpan &left, const TimeSpan &right)
Checks whether left time interval greater than right one.
ONIXS_B3_UMDF_MD_HOTPATH void setFixedStr(BlockLength offset, StrRef value, SchemaVersion since)
Sets the field value.
const void * block() const
ONIXS_B3_UMDF_MD_HOTPATH bool decimal(Value &value, BlockLength offset, NullValue null) const
SbeGroupEntries(void *encoded, BlockLength blockLength, Size groupSize, SchemaVersion version)
Initializes the instance referencing to data.
ONIXS_B3_UMDF_MD_HOTPATH SbeVariableLengthFieldList< BinarySize > variableLengthFields() const
void checkVersion(SchemaVersion since, SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
char Char
Character type alias.
ONIXS_B3_UMDF_MD_HOTPATH void setFixedStr(BlockLength offset, StrRef value)
Sets the field value.
void checkSchema(SchemaId id, SchemaVersion version)
Checks the compatibility with the provided SBE Schema version.
Operations over SBE-encoded repeating group entries.
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_END
ONIXS_B3_UMDF_MD_HOTPATH BinarySize binarySize() const
void setVariableLengthField(Callable callable, StrRef value, SchemaVersion since, Owner &owner)
Sets the value of the variable length field.
ONIXS_B3_UMDF_MD_HOTPATH SbeGroup(void *data, ONIXS_B3_UMDF_MD_UNUSED BinarySize size, SchemaVersion version)
Initializes an instance referencing to a valid group of a given message.
ONIXS_B3_UMDF_MD_HOTPATH Iterator begin() const
UInt16 MessageSize
Message length type.
ONIXS_B3_UMDF_MD_HOTPATH bool decimal(Value &value, BlockLength offset, NullValue null, SchemaVersion since) const
SbeGroup()
Initializes a blank instance referencing to nothing.
EncodedLength encodedLength() const
void setVariableLengthField(Callable callable, StrRef value, Owner &owner)
Sets the value of the variable length field.
MessageSize BlockLength
Length of the message body representing a block of fixed-length fields.
An iterator over SBE-encoded group entries.
Iterator()
Initializes the instance that refers to nothing.
ONIXS_B3_UMDF_MD_HOTPATH bool ordinary(Value &value, BlockLength offset, NullValue null, SchemaVersion since) const
Provides access to an optional field value.
StrRef getVariableLengthField(Callable callable, SchemaVersion since, Owner &owner) const
BinaryBlock()
Initializes a blank instance.
void resetGroup(Callable callable, Owner &owner)
Sets the group to the initial state.
ptrdiff_t difference_type
ONIXS_B3_UMDF_MD_HOTPATH void constructGroup(Group &group, typename Group::Size entryCount, const void *messageTail)
Initializes the group header, sets all optional fields to null.
ONIXS_B3_UMDF_MD_HOTPATH void setEnumeration(BlockLength offset, typename Enumeration::Enum value)
Sets the field value.
SchemaVersion version() const
ONIXS_B3_UMDF_MD_HOTPATH void setEnumeration(BlockLength offset, typename Enumeration::Enum value, SchemaVersion since)
Sets the field value.
Group getGroup(Callable callable, Owner &owner) const
NumInGroup Size
Number of entries in the collection.
BlockLength blockLength() const
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_BEGIN
ONIXS_B3_UMDF_MD_HOTPATH SbeVariableLengthFieldList tail() const
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
void clear()
Blank the instance.
#define ONIXS_B3_UMDF_MD_LTWT_EXPORTED
BinaryVariableLengthFieldType & head() const
SbeVariableLengthFieldList< MessageSize > VariableLengthFieldList
Sets the variable length field value.
ONIXS_B3_UMDF_MD_HOTPATH void zeroPaddingBytes(BlockLength offset)
If specified, the extra space is padded at the end of each entry and should be set to zeroes by encod...
Group getGroup(Callable callable, SchemaVersion since, Owner &owner) const
#define ONIXS_B3_UMDF_MD_LTWT_CLASS
const UInt16 MaxMessageSize
Maximum supported message size.
Entries::Iterator Iterator
The iterator type for group entries.
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...
ONIXS_B3_UMDF_MD_HOTPATH void * binary() const
#define ONIXS_B3_UMDF_MD_CHECK_NOTHROW(equation)
StrRef getVariableLengthField(Callable callable, const Owner &owner) const
Entries::Size Size
Number of entries in the group.
Timestamp operator-(const Timestamp ×tamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
void setVariableLengthFieldToNull(Callable callable, SchemaVersion since, Owner &owner)
Sets the variable length field to null.
EntryType Entry
The type of the repeating group entry.
ONIXS_B3_UMDF_MD_HOTPATH SbeMessage(const void *data, MessageSize size)
Initializes the instance over the given memory block.
Variable-length fields list.
SbeFields()
Initializes a blank instance.
ONIXS_B3_UMDF_MD_HOTPATH SbeVariableLengthFieldList(void *binary, BinarySize size, SchemaVersion version)
Initializes the list over the given memory block.
Base services to access fields stored in an SBE-encoded block of memory.
ONIXS_B3_UMDF_MD_API static ONIXS_B3_UMDF_MD_NODISCARD MessageSize getMaxMessageSize()
Maximal message size.
ONIXS_B3_UMDF_MD_HOTPATH MessageSize calculateBinarySize(const void *tail) const
ONIXS_B3_UMDF_MD_HOTPATH SbeGroupList(void *binary, BinarySize size, SchemaVersion version)
Initializes the list over the memory block.
ONIXS_B3_UMDF_MD_HOTPATH SbeVariableLengthFieldList< BinarySize > checkVariableLengthFields() const
Checks the variable length fields list consistency.
Group setupGroup(Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
Setups the repeating group with the given number of entries.
MessageHeader::SchemaId SchemaId
ONIXS_B3_UMDF_MD_HOTPATH GroupList groups() const
bool operator==(const TimeSpan &left, const TimeSpan &right)
Compares with other instance for equality.
ONIXS_B3_UMDF_MD_HOTPATH VariableLengthFieldList variableLengthFields() const
ONIXS_B3_UMDF_MD_HOTPATH SbeGroupList checkTail() const
Checks the list consistency.
ONIXS_B3_UMDF_MD_HOTPATH SbeGroupEntry(const void *encoded, BlockLength size, SchemaVersion version)
Initializes the instance from the memory block of the encoded message.
Length EncodedLength
The length of the binary data occupied by the group entries.
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...
SbeGroupEntries()
Initializes a blank instance referencing to nothing.
ONIXS_B3_UMDF_MD_HOTPATH void initGroup(Group &group, typename Group::EntrySize entrySize)
Resets the group to the initial state.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
ONIXS_B3_UMDF_MD_HOTPATH Size size() const
void checkSchemaId(SchemaId id)
Checks the compatibility with the provided SBE Schema ID.
ONIXS_B3_UMDF_MD_HOTPATH bool fixedStr(StrRef &value, BlockLength offset, SchemaVersion since) const
Provides access to an optional string field value.
SbeGroupEntries< EntryType, typename Dimension::BlockLength, typename Dimension::NumInGroup, GroupSizeType > Entries
Binary group blocks.
SchemaId schemaId() const
ONIXS_B3_UMDF_MD_HOTPATH bool enumeration(typename Enumeration::Enum &value, BlockLength offset, NullValue null) const
Provides access to an optional field value.
const void * block() const
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
ONIXS_B3_UMDF_MD_NODISCARD Entries entries() const
ONIXS_B3_UMDF_MD_HOTPATH SbeVariableLengthFieldList checkTail() const
Checks the variable-length field list consistency.
const void * encoded() const