OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
SbeMessage Class Reference

Classes

struct  NoCheck
struct  NoFieldsInit
struct  NoInit

Public Types

typedef MessageSize EncodedLength
typedef MessageSize BlockLength

Public Member Functions

 SbeMessage () noexcept
 SbeMessage (void *data, MessageSize size, SchemaVersion version)
 SbeMessage (void *data, MessageSize size)
 SbeMessage (void *data, MessageSize size, NoCheck) noexcept
void clear () noexcept
bool valid () const noexcept
 operator bool () const noexcept
MessageTemplateId templateId () const noexcept
SchemaVersion version () const noexcept
SchemaId schemaId () const noexcept
SequenceId sequenceId () const noexcept
SbeMessagesequenceId (SequenceId value) noexcept
Timestamp sendTime () const noexcept
SbeMessagesendTime (Timestamp value) noexcept
HeaderFlags headerFlags () const noexcept
SbeMessageheaderFlags (HeaderFlags value) noexcept
const void * binary () const noexcept
void * binary () noexcept
const void * blockEnd () noexcept
const void * blockEnd () const noexcept
MessageSize bufferSize () const noexcept
void * body () noexcept
BlockLength blockLength () const noexcept
const void * block () const noexcept
void * block () noexcept
Public Member Functions inherited from SbeFields< Messaging::SbeMessage, MessageSize >
ONIXS_ICEBOE_FORCEINLINE Messaging::SbeMessagecontainer () noexcept
void zeroPaddingBytes (MessageSize offset) noexcept
ONIXS_ICEBOE_FORCEINLINE void setOrdinary (MessageSize offset, FieldValue value) noexcept
ONIXS_ICEBOE_FORCEINLINE void setEnumeration (MessageSize offset, Enumeration value) noexcept
ONIXS_ICEBOE_FORCEINLINE void setFixedStr (MessageSize offset, StrRef value) noexcept

Protected Types

typedef SbeGroupList< MessageSizeGroupList
typedef SbeVariableLengthFieldList< MessageSizeVariableLengthFieldList

Protected Member Functions

SbeMessageversion (SchemaVersion version) noexcept
GroupList groups () noexcept
GroupList groups () const noexcept
template<typename Group>
void initGroup (Group &group, typename Group::EntrySize entrySize) noexcept
template<typename Group>
void setupGroup (Group &group, typename Group::Size entryCount, const void *messageTail)
template<typename Group>
void constructGroup (Group &group, typename Group::Size entryCount, const void *messageTail)
template<typename DATA>
void setVarDataField (DATA &data, StrRef value, const void *oldMessageTail)
VariableLengthFieldList variableLengthFields () noexcept
VariableLengthFieldList variableLengthFields () const noexcept
void init (MessageHeader::TemplateId value, MessageHeader::BlockLength minimalBlockLength, MessageHeader::BlockLength blockLength, SchemaId id) noexcept
MessageSize calculateBinarySize (const void *tail) const noexcept
template<class Callable, class Owner>
void setVariableLengthField (Callable callable, StrRef value, Owner &owner)
template<class Callable, class Owner>
void setVariableLengthField (Callable callable, StrRef value, SchemaVersion since, Owner &owner)
template<class Callable, class Owner>
StrRef getVariableLengthField (Callable callable, const Owner &owner) const noexcept
template<class Callable, class Owner>
StrRef getVariableLengthField (Callable callable, SchemaVersion since, Owner &owner) const noexcept
template<class Callable, class Owner>
void setVariableLengthFieldToNull (Callable callable, Owner &owner) noexcept
template<class Group, class Callable, class Owner>
void resetGroup (Callable callable, Owner &owner) noexcept
template<class Callable, class Owner>
void setVariableLengthFieldToNull (Callable callable, SchemaVersion since, Owner &owner) noexcept
template<class Group, class Callable, class Owner>
void resetGroup (Callable callable, SchemaVersion since, Owner &owner)
template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group getGroup (Callable callable, Owner &owner) const noexcept
template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group getGroup (Callable callable, SchemaVersion since, Owner &owner) const noexcept
template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group constructGroup (Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group constructGroup (Callable callable, typename Group::Size length, Owner &owner)
template<class Group, class Callable, class Owner>
Group setupGroup (Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
template<class Group, class Callable, class Owner>
Group setupGroup (Callable callable, typename Group::Size length, Owner &owner)
Protected Member Functions inherited from SbeFields< Messaging::SbeMessage, MessageSize >
 SbeFields ()=default
 ~SbeFields ()=default
Protected Member Functions inherited from BinaryBlock< Messaging::SbeMessage, MessageSize >
 BinaryBlock ()=default
 ~BinaryBlock ()=default
ONIXS_ICEBOE_FORCEINLINE Value ordinary (MessageSize offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE Enumeration enumeration (MessageSize offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE StrRef fixedStr (MessageSize offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE Value decimal (MessageSize offset) const noexcept
ONIXS_ICEBOE_FORCEINLINE std::enable_if<!isComposite< typenameNullValue::Value >::value, SbeOptionalConverted< decltype(std::declval< Callable >()(std::declval< typenameArgType< Callable >::type >()))> >::type convertible (MessageSize offset, OptionalTag) const noexcept(noexcept(Callable::Nothrow))
Protected Member Functions inherited from BinaryBlockBase
 ~BinaryBlockBase ()=default

Static Protected Member Functions

static constexpr MessageSize getMaxMessageSize () noexcept

Detailed Description

Definition at line 1172 of file SbeMessage.h.

Member Typedef Documentation

◆ BlockLength

Length of the message body representing a block of fixed-length fields.

Definition at line 1184 of file SbeMessage.h.

◆ EncodedLength

Length of the message binary data.

Definition at line 1181 of file SbeMessage.h.

◆ GroupList

typedef SbeGroupList<MessageSize> GroupList
protected

Binary group list instantiation.

Definition at line 1409 of file SbeMessage.h.

◆ VariableLengthFieldList

Binary group list instantiation.

Definition at line 1499 of file SbeMessage.h.

Constructor & Destructor Documentation

◆ SbeMessage() [1/4]

SbeMessage ( )
inlinenoexcept

Initializes a blank instance.

Definition at line 1187 of file SbeMessage.h.

1188 : header_(nullptr)
1189 , size_(0)
1190 {
1191 }

◆ SbeMessage() [2/4]

SbeMessage ( void * data,
MessageSize size,
SchemaVersion version )
inline

Initializes the instance over the given memory block.

Definition at line 1195 of file SbeMessage.h.

1196 : header_(static_cast<MessageHeader*>(data))
1197 , size_(size)
1198 {
1199 assert(data);
1200 assert(size <= MaxSbeMessageSize);
1201
1202 if ONIXS_ICEBOE_UNLIKELY(size < MessageHeader::Size)
1203 throwBinaryBlockIsTooSmall(size, MessageHeader::Size);
1204
1205 this->version(version);
1206 }
void throwBinaryBlockIsTooSmall(MessageSize actual, MessageSize required)
Raises an exception when the given binary block is too small.
const char * version() noexcept

◆ SbeMessage() [3/4]

SbeMessage ( void * data,
MessageSize size )
inline

Initializes the instance over the given memory block.

Definition at line 1210 of file SbeMessage.h.

1211 : header_(static_cast<MessageHeader*>(data))
1212 , size_(size)
1213 {
1214 assert(data);
1215 assert(size <= MaxSbeMessageSize);
1216
1217 if ONIXS_ICEBOE_UNLIKELY(size < MessageHeader::Size)
1218 throwBinaryBlockIsTooSmall(size, MessageHeader::Size);
1219
1220 // Now it is safe to read header_.
1221 if ONIXS_ICEBOE_UNLIKELY(size < (MessageHeader::Size + header_->blockLength()))
1222 throwBinaryBlockIsTooSmall(size, MessageHeader::Size + header_->blockLength());
1223 }

◆ SbeMessage() [4/4]

SbeMessage ( void * data,
MessageSize size,
NoCheck  )
inlinenoexcept

Initializes the instance over the given memory block.

Note
Performs no check of the data consistency

Definition at line 1229 of file SbeMessage.h.

1230 : header_(static_cast<MessageHeader*>(data))
1231 , size_(size)
1232 {
1233 assert(data);
1234 assert(size <= MaxSbeMessageSize);
1235
1236 assert(size >= MessageHeader::Size);
1237 assert(size >= MessageHeader::Size + header_->blockLength());
1238 }

Member Function Documentation

◆ binary() [1/2]

const void * binary ( ) const
inlinenoexcept
Returns
SBE-encoded message content.

Definition at line 1338 of file SbeMessage.h.

1339 {
1340 assert(valid());
1341
1342 return header_;
1343 }

◆ binary() [2/2]

void * binary ( )
inlinenoexcept
Returns
SBE-encoded message content.

Definition at line 1346 of file SbeMessage.h.

1347 {
1348 assert(valid());
1349
1350 return header_;
1351 }

◆ block() [1/2]

const void * block ( ) const
inlinenoexcept
Returns
the beginning of the message body.

Definition at line 1392 of file SbeMessage.h.

1393 {
1394 assert(valid());
1395
1396 return advanceByBytes(header_, MessageHeader::Size);
1397 }
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

◆ block() [2/2]

void * block ( )
inlinenoexcept
Returns
the beginning of the message body.

Definition at line 1400 of file SbeMessage.h.

1401 {
1402 assert(valid());
1403
1404 return advanceByBytes(header_, MessageHeader::Size);
1405 }

◆ blockEnd() [1/2]

const void * blockEnd ( ) const
inlinenoexcept

Definition at line 1362 of file SbeMessage.h.

1363 {
1364 assert(valid());
1365
1366 return advanceByBytes(header_, size_);
1367 }

◆ blockEnd() [2/2]

const void * blockEnd ( )
inlinenoexcept

Definition at line 1354 of file SbeMessage.h.

1355 {
1356 assert(valid());
1357
1358 return advanceByBytes(header_, size_);
1359 }

◆ blockLength()

BlockLength blockLength ( ) const
inlinenoexcept
Returns
the size of the message body in bytes.

Definition at line 1384 of file SbeMessage.h.

1385 {
1386 assert(valid());
1387
1388 return header_->blockLength();
1389 }

◆ body()

void * body ( )
inlinenoexcept
Returns
the beginning of the message body.

Definition at line 1376 of file SbeMessage.h.

1377 {
1378 assert(valid());
1379
1380 return advanceByBytes(header_, MessageHeader::Size);
1381 }

◆ bufferSize()

MessageSize bufferSize ( ) const
inlinenoexcept
Returns
the size of the message buffer.

Definition at line 1370 of file SbeMessage.h.

1371 {
1372 return size_;
1373 }

◆ calculateBinarySize()

MessageSize calculateBinarySize ( const void * tail) const
inlineprotectednoexcept

Definition at line 1548 of file SbeMessage.h.

1549 {
1550 assert(tail);
1551
1552 const ptrdiff_t distance = byteDistance(tail, binary());
1553
1554 assert(distance > 0);
1555
1556 assert(distance <= (std::numeric_limits<MessageSize>::max)());
1557
1558 const MessageSize size = static_cast<MessageSize>(distance);
1559
1560 assert(size <= size_);
1561
1562 return size;
1563 }
constexpr std::enable_if<!details::HasMemberTraits< Value >::value, size_t >::type size() noexcept
Definition Memory.h:303
UInt16 MessageSize
Message length type.
Definition Aliases.h:29
ONIXS_ICEBOE_FORCEINLINE ptrdiff_t byteDistance(Left *left, Right *right) noexcept
Definition Memory.h:135

◆ clear()

void clear ( )
inlinenoexcept

Blank the instance.

Definition at line 1241 of file SbeMessage.h.

1242 {
1243 *this = SbeMessage();
1244 assert(!valid());
1245 }

◆ constructGroup() [1/3]

template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group constructGroup ( Callable callable,
typename Group::Size length,
Owner & owner )
inlineprotected

Creates a repeating group with the given number of entries, sets all optional fields of the group entries to null.

Definition at line 1673 of file SbeMessage.h.

1674 {
1675 Group group = callable(owner);
1676
1677 constructGroup(group, length, owner.tail());
1678
1679 return group;
1680 }

◆ constructGroup() [2/3]

template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group constructGroup ( Callable callable,
typename Group::Size length,
SchemaVersion since,
Owner & owner )
inlineprotected

Creates a repeating group with the given number of entries, sets all optional fields of the group entries to null.

Definition at line 1662 of file SbeMessage.h.

1663 {
1664 if ONIXS_ICEBOE_UNLIKELY(since > version())
1665 return Group();
1666
1667 return constructGroup<Group>(callable, length, owner);
1668 }

◆ constructGroup() [3/3]

template<typename Group>
void constructGroup ( Group & group,
typename Group::Size entryCount,
const void * messageTail )
inlineprotected

Initializes the group header, sets all optional fields to null.

Definition at line 1469 of file SbeMessage.h.

1470 {
1471 assert(messageTail);
1472 assert(group.valid());
1473 group.construct(entryCount, messageTail, blockEnd());
1474 }

◆ getGroup() [1/2]

template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group getGroup ( Callable callable,
Owner & owner ) const
inlineprotectednoexcept
Returns
the repeating group.

Definition at line 1642 of file SbeMessage.h.

1643 {
1644 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1645 return callable(owner);
1646 }

◆ getGroup() [2/2]

template<class Group, class Callable, class Owner>
ONIXS_ICEBOE_FORCEINLINE Group getGroup ( Callable callable,
SchemaVersion since,
Owner & owner ) const
inlineprotectednoexcept
Returns
the repeating group.

Definition at line 1651 of file SbeMessage.h.

1652 {
1653 if ONIXS_ICEBOE_UNLIKELY(since > version())
1654 return Group();
1655
1656 return getGroup<Group>(callable, owner);
1657 }

◆ getMaxMessageSize()

constexpr MessageSize getMaxMessageSize ( )
inlinestaticconstexprprotectednoexcept

Maximal message size.

Definition at line 1707 of file SbeMessage.h.

1708 {
1709 return
1711 }
constexpr UInt16 MaxSbeMessageSize
Maximum supported message size.

◆ getVariableLengthField() [1/2]

template<class Callable, class Owner>
StrRef getVariableLengthField ( Callable callable,
const Owner & owner ) const
inlineprotectednoexcept
Returns
the value of the variable length field.

Definition at line 1584 of file SbeMessage.h.

1585 {
1586 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1587 return callable(owner).varData();
1588 }

◆ getVariableLengthField() [2/2]

template<class Callable, class Owner>
StrRef getVariableLengthField ( Callable callable,
SchemaVersion since,
Owner & owner ) const
inlineprotectednoexcept
Returns
the value of the variable length field.

Definition at line 1592 of file SbeMessage.h.

1593 {
1594 if ONIXS_ICEBOE_UNLIKELY(since > version())
1595 return StrRef();
1596
1597 return getVariableLengthField(callable, owner);
1598 }

◆ groups() [1/2]

GroupList groups ( ) const
inlineprotectednoexcept
Returns
the list of repeating groups

Definition at line 1436 of file SbeMessage.h.

1437 {
1438 assert(header_);
1439
1440 const void* list = advanceByBytes(block(), blockLength());
1441
1442 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1443
1444 return GroupList(const_cast<void*>(list), listSize, header_->version());
1445 }

◆ groups() [2/2]

GroupList groups ( )
inlineprotectednoexcept
Returns
the list of repeating groups

Definition at line 1423 of file SbeMessage.h.

1424 {
1425 assert(header_);
1426
1427 void* list = advanceByBytes<void>(body(), blockLength());
1428
1429 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1430
1431 return GroupList(list, listSize, header_->version());
1432 }

◆ headerFlags() [1/2]

HeaderFlags headerFlags ( ) const
inlinenoexcept
Returns
Send Time.

Definition at line 1320 of file SbeMessage.h.

1321 {
1322 assert(valid());
1323
1324 return header_->headerFlags();
1325 }

◆ headerFlags() [2/2]

SbeMessage & headerFlags ( HeaderFlags value)
inlinenoexcept

Sets Send Time.

Definition at line 1328 of file SbeMessage.h.

1329 {
1330 assert(valid());
1331
1332 header_->headerFlags(value);
1333
1334 return *this;
1335 }

◆ init()

void init ( MessageHeader::TemplateId value,
MessageHeader::BlockLength minimalBlockLength,
MessageHeader::BlockLength blockLength,
SchemaId id )
inlineprotectednoexcept

Definition at line 1528 of file SbeMessage.h.

1533 {
1534 assert(header_);
1535 assert(blockLength >= minimalBlockLength);
1536
1537 header_->templateId(value);
1538 header_->blockLength(blockLength);
1539 header_->schemaId(id);
1540 header_->sequenceId(0);
1541 header_->sendTime(Timestamp{});
1542 header_->headerFlags(HeaderFlags::None);
1543
1544 zeroPaddingBytes(minimalBlockLength);
1545 }

◆ initGroup()

template<typename Group>
void initGroup ( Group & group,
typename Group::EntrySize entrySize )
inlineprotectednoexcept

Resets the group to the initial state.

Definition at line 1450 of file SbeMessage.h.

1451 {
1452 assert(group.valid());
1453 group.init(entrySize);
1454 }

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Definition at line 1253 of file SbeMessage.h.

1254 {
1255 return valid();
1256 }

◆ resetGroup() [1/2]

template<class Group, class Callable, class Owner>
void resetGroup ( Callable callable,
Owner & owner )
inlineprotectednoexcept

Sets the group to the initial state.

Definition at line 1610 of file SbeMessage.h.

1611 {
1612 const typename Group::EntrySize entrySize = Group::Entry::blockLength(version());
1613
1614 Group grp = callable(owner);
1615
1616 initGroup(grp, entrySize);
1617 }

◆ resetGroup() [2/2]

template<class Group, class Callable, class Owner>
void resetGroup ( Callable callable,
SchemaVersion since,
Owner & owner )
inlineprotected

Resets the repeating group.

Definition at line 1631 of file SbeMessage.h.

1632 {
1633 if ONIXS_ICEBOE_UNLIKELY(since > version())
1634 return;
1635
1636 resetGroup<Group>(callable, owner);
1637 }

◆ schemaId()

SchemaId schemaId ( ) const
inlinenoexcept
Returns
SBE Schema ID.

Definition at line 1275 of file SbeMessage.h.

1276 {
1277 assert(valid());
1278
1279 return header_->schemaId();
1280 }

◆ sendTime() [1/2]

Timestamp sendTime ( ) const
inlinenoexcept
Returns
Send Time.

Definition at line 1301 of file SbeMessage.h.

1302 {
1303 assert(valid());
1304
1305 return header_->sendTime();
1306 }

◆ sendTime() [2/2]

SbeMessage & sendTime ( Timestamp value)
inlinenoexcept

Sets Send Time.

Definition at line 1310 of file SbeMessage.h.

1311 {
1312 assert(valid());
1313
1314 header_->sendTime(value);
1315
1316 return *this;
1317 }

◆ sequenceId() [1/2]

SequenceId sequenceId ( ) const
inlinenoexcept
Returns
Sequence ID.

Definition at line 1283 of file SbeMessage.h.

1284 {
1285 assert(valid());
1286
1287 return header_->sequenceId();
1288 }

◆ sequenceId() [2/2]

SbeMessage & sequenceId ( SequenceId value)
inlinenoexcept

Sets Sequence ID.

Definition at line 1291 of file SbeMessage.h.

1292 {
1293 assert(valid());
1294
1295 header_->sequenceId(value);
1296
1297 return *this;
1298 }

◆ setupGroup() [1/3]

template<class Group, class Callable, class Owner>
Group setupGroup ( Callable callable,
typename Group::Size length,
Owner & owner )
inlineprotected

Setups the repeating group with the given number of entries.

Definition at line 1694 of file SbeMessage.h.

1695 {
1696 Group group = callable(owner);
1697
1698 setupGroup(group, length, owner.tail());
1699
1700 return group;
1701 }

◆ setupGroup() [2/3]

template<class Group, class Callable, class Owner>
Group setupGroup ( Callable callable,
typename Group::Size length,
SchemaVersion since,
Owner & owner )
inlineprotected

Setups the repeating group with the given number of entries.

Definition at line 1684 of file SbeMessage.h.

1685 {
1686 if ONIXS_ICEBOE_UNLIKELY(since > version())
1687 return Group();
1688
1689 return setupGroup<Group>(callable, length, owner);
1690 }

◆ setupGroup() [3/3]

template<typename Group>
void setupGroup ( Group & group,
typename Group::Size entryCount,
const void * messageTail )
inlineprotected

Initializes the group header.

Definition at line 1459 of file SbeMessage.h.

1460 {
1461 assert(messageTail);
1462 assert(group.valid());
1463 group.setup(entryCount, messageTail, blockEnd());
1464 }

◆ setVarDataField()

template<typename DATA>
void setVarDataField ( DATA & data,
StrRef value,
const void * oldMessageTail )
inlineprotected

Sets the variable length field value.

Definition at line 1478 of file SbeMessage.h.

1479 {
1480 assert(oldMessageTail);
1481
1482 const ptrdiff_t lengthChange = static_cast<ptrdiff_t>(value.length() - data.length());
1483
1484 const void* const newMessageTail = advanceByBytes(oldMessageTail, lengthChange);
1485
1486 if ONIXS_ICEBOE_UNLIKELY(byteDistance(blockEnd(), newMessageTail) < 0)
1487 throwNotEnoughSpace();
1488
1489 const void* const oldEndOfData = advanceByBytes(data.varData().data(), data.varData().size());
1490
1491 void* const newEndOfData = toOpaquePtr(advanceByBytes(&data, value.length() + DATA::Size));
1492
1493 std::memmove(newEndOfData, oldEndOfData, byteDistance(oldMessageTail, oldEndOfData));
1494
1495 data.varData(value);
1496 }

◆ setVariableLengthField() [1/2]

template<class Callable, class Owner>
void setVariableLengthField ( Callable callable,
StrRef value,
Owner & owner )
inlineprotected

Sets the value of the variable length field.

Definition at line 1567 of file SbeMessage.h.

1568 {
1569 setVarDataField(callable(owner), value, owner.tail());
1570 }

◆ setVariableLengthField() [2/2]

template<class Callable, class Owner>
void setVariableLengthField ( Callable callable,
StrRef value,
SchemaVersion since,
Owner & owner )
inlineprotected

Sets the value of the variable length field.

Definition at line 1574 of file SbeMessage.h.

1575 {
1576 if ONIXS_ICEBOE_UNLIKELY(since > version())
1577 throwDisallowedField();
1578
1579 setVariableLengthField(callable, value, owner);
1580 }

◆ setVariableLengthFieldToNull() [1/2]

template<class Callable, class Owner>
void setVariableLengthFieldToNull ( Callable callable,
Owner & owner )
inlineprotectednoexcept

Resets the variable length field.

Definition at line 1602 of file SbeMessage.h.

1603 {
1604 ONIXS_ICEBOE_CHECK_NOTHROW(callable(owner));
1605 callable(owner).length(0);
1606 }

◆ setVariableLengthFieldToNull() [2/2]

template<class Callable, class Owner>
void setVariableLengthFieldToNull ( Callable callable,
SchemaVersion since,
Owner & owner )
inlineprotectednoexcept

Sets the variable length field to null.

Definition at line 1621 of file SbeMessage.h.

1622 {
1623 if ONIXS_ICEBOE_UNLIKELY(since > version())
1624 return;
1625
1626 setVariableLengthFieldToNull(callable, owner);
1627 }

◆ templateId()

MessageTemplateId templateId ( ) const
inlinenoexcept
Returns
SBE Template identifier.

Definition at line 1259 of file SbeMessage.h.

1260 {
1261 assert(valid());
1262
1263 return header_->templateId();
1264 }

◆ valid()

bool valid ( ) const
inlinenoexcept
Returns
true if the instance refers to a valid message, otherwise - false.

Definition at line 1248 of file SbeMessage.h.

1249 {
1250 return (nullptr != header_);
1251 }

◆ variableLengthFields() [1/2]

VariableLengthFieldList variableLengthFields ( ) const
inlineprotectednoexcept
Returns
the list of variable-length fields.

Definition at line 1516 of file SbeMessage.h.

1517 {
1518 assert(header_);
1519
1520 const void* list = advanceByBytes(block(), blockLength());
1521
1522 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1523
1524 return VariableLengthFieldList(const_cast<void*>(list), listSize, header_->version());
1525 }

◆ variableLengthFields() [2/2]

VariableLengthFieldList variableLengthFields ( )
inlineprotectednoexcept
Returns
the list of variable-length fields.

Definition at line 1503 of file SbeMessage.h.

1504 {
1505 assert(header_);
1506
1507 void* list = advanceByBytes<void>(body(), blockLength());
1508
1509 const MessageSize listSize = size_ - MessageHeader::Size - header_->blockLength();
1510
1511 return VariableLengthFieldList(list, listSize, header_->version());
1512 }

◆ version() [1/2]

SchemaVersion version ( ) const
inlinenoexcept
Returns
SBE Schema version.

Definition at line 1267 of file SbeMessage.h.

1268 {
1269 assert(valid());
1270
1271 return header_->version();
1272 }

◆ version() [2/2]

SbeMessage & version ( SchemaVersion version)
inlineprotectednoexcept

Sets the SBE Schema version.

Definition at line 1412 of file SbeMessage.h.

1413 {
1414 assert(valid());
1415
1416 header_->version(version);
1417
1418 return *this;
1419 }