OnixS C++ B3 Binary UMDF Market Data Handler 1.10.0
Users' manual and API documentation
Loading...
Searching...
No Matches
SbeMessage Class Reference

#include <OnixS/B3/MarketData/UMDF/messaging/SbeMessage.h>

Classes

struct  NoCheck
struct  NoFieldsInit
struct  NoInit

Public Types

typedef MessageSize EncodedLength
typedef MessageSize BlockLength

Public Member Functions

 SbeMessage () noexcept
 __attribute__ ((__hot__)) SbeMessage(const void *data
MessageSize size_ (size)
 __attribute__ ((__hot__)) SbeMessage(void *data
MessageSize NoCheck size_ (size)
void clear () noexcept
bool valid () const noexcept
MessageTemplateId templateId () const noexcept
SchemaVersion version () const noexcept
SchemaId schemaId () const noexcept
const void * binary () const noexcept
const void * blockEnd () noexcept
const void * blockEnd () const noexcept
MessageSize bufferSize () const noexcept
BlockLength blockLength () const noexcept
const void * block () const noexcept
Public Member Functions inherited from SbeFields< Messaging::SbeMessage, MessageSize >
Messaging::SbeMessagecontainer () noexcept
 __attribute__ ((__hot__)) void zeroPaddingBytes(MessageSize offset) noexcept
 setValue (fieldPos, value)
 setOrdinary (offset, value)
 assert (value.size()<=Size &&"The string is truncated.")
if(sizeToCopy > 0) std std::memset (advanceByBytes(fieldPos, sizeToCopy), 0, Size - sizeToCopy)
 setFixedStr (offset, value)

Public Attributes

MessageSize size: header_(static_cast<const MessageHeader*>(data))
MessageSize NoCheck noexcept: header_(static_cast<MessageHeader*>(data))
Public Attributes inherited from SbeFields< Messaging::SbeMessage, MessageSize >
FieldValue value noexcept
void *const fieldPos
FieldValue value
FieldValue SchemaVersion since
const size_t sizeToCopy

Protected Types

typedef SbeGroupList< MessageSizeGroupList
typedef SbeVariableLengthFieldList< MessageSizeVariableLengthFieldList

Protected Member Functions

 __attribute__ ((__hot__)) GroupList groups() const noexcept
template<typename Group>
 __attribute__ ((__hot__)) void initGroup(Group &group
group init (entrySize)
template<typename Group>
 __attribute__ ((__hot__)) void setupGroup(Group &group
 assert (group.valid())
group setup (entryCount, messageTail, blockEnd())
template<typename Group>
 __attribute__ ((__hot__)) void const ructGroup(Group &group
 assert (group.valid())
group construct (entryCount, messageTail, blockEnd())
 __attribute__ ((__hot__)) VariableLengthFieldList variableLengthFields() const noexcept
 __attribute__ ((__hot__)) 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>
Group getGroup (Callable callable, Owner &owner) const noexcept
template<class Group, class Callable, class Owner>
Group getGroup (Callable callable, SchemaVersion since, Owner &owner) const noexcept
template<class Group, class Callable, class Owner>
Group constructGroup (Callable callable, typename Group::Size length, SchemaVersion since, Owner &owner)
template<class Group, class Callable, class Owner>
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)
ONIXS_B3_UMDF_MD_API __attribute__ ((__warn_unused_result__)) const expr static MessageSize getMaxMessageSize() noexcept
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
 __attribute__ ((__hot__)) Value ordinary(MessageSize offset) const noexcept
 return (null !=value)

Protected Attributes

Group::EntrySize entrySize noexcept
Group::Size entryCount
Group::Size const void * messageTail
Protected Attributes inherited from BinaryBlock< Messaging::SbeMessage, MessageSize >
MessageSize offset
MessageSize NullValue null const noexcept
MessageSize NullValue null

Detailed Description

Definition at line 1108 of file SbeMessage.h.

Member Typedef Documentation

◆ BlockLength

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

Definition at line 1120 of file SbeMessage.h.

◆ EncodedLength

Length of the message binary data.

Definition at line 1117 of file SbeMessage.h.

◆ GroupList

typedef SbeGroupList<MessageSize> GroupList
protected

Binary group list instantiation.

Definition at line 1285 of file SbeMessage.h.

◆ VariableLengthFieldList

Sets the variable length field value.

Binary group list instantiation.

Definition at line 1374 of file SbeMessage.h.

Constructor & Destructor Documentation

◆ SbeMessage()

SbeMessage ( )
inlinenoexcept

Initializes a blank instance.

Definition at line 1123 of file SbeMessage.h.

Member Function Documentation

◆ __attribute__() [1/9]

__attribute__ ( (__hot__) ) const
inlineprotectednoexcept
Returns
the list of repeating groups

Definition at line 1311 of file SbeMessage.h.

◆ __attribute__() [2/9]

__attribute__ ( (__hot__) ) const
inlineprotectednoexcept

Definition at line 1419 of file SbeMessage.h.

◆ __attribute__() [3/9]

__attribute__ ( (__hot__) ) const

Initializes the instance over the given memory block.

◆ __attribute__() [4/9]

__attribute__ ( (__hot__) )

Initializes the instance over the given memory block.

Note
Performs no check of the data consistency

◆ __attribute__() [5/9]

__attribute__ ( (__hot__) ) const
inlineprotectednoexcept
Returns
the list of variable-length fields.

Definition at line 1390 of file SbeMessage.h.

◆ __attribute__() [6/9]

template<typename Group>
__attribute__ ( (__hot__) ) const &
protected

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

◆ __attribute__() [7/9]

template<typename Group>
__attribute__ ( (__hot__) ) &
protected

Resets the group to the initial state.

◆ __attribute__() [8/9]

template<typename Group>
__attribute__ ( (__hot__) ) &
protected

Initializes the group header.

◆ __attribute__() [9/9]

ONIXS_B3_UMDF_MD_API __attribute__ ( (__warn_unused_result__) ) const
inlineprotectednoexcept

Maximal message size.

Definition at line 1573 of file SbeMessage.h.

◆ assert() [1/2]

assert ( group. valid())
protected

◆ assert() [2/2]

assert ( group. valid())
protected

◆ binary()

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

Definition at line 1214 of file SbeMessage.h.

◆ block()

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

Definition at line 1268 of file SbeMessage.h.

◆ blockEnd() [1/2]

const void * blockEnd ( ) const
inlinenoexcept

Definition at line 1238 of file SbeMessage.h.

◆ blockEnd() [2/2]

const void * blockEnd ( )
inlinenoexcept

Definition at line 1230 of file SbeMessage.h.

◆ blockLength()

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

Definition at line 1260 of file SbeMessage.h.

◆ bufferSize()

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

Definition at line 1246 of file SbeMessage.h.

◆ clear()

void clear ( )
inlinenoexcept

Blank the instance.

Definition at line 1177 of file SbeMessage.h.

◆ construct()

group construct ( entryCount ,
messageTail ,
blockEnd()  )
protected

◆ constructGroup() [1/2]

template<class Group, class Callable, class Owner>
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 1541 of file SbeMessage.h.

◆ constructGroup() [2/2]

template<class Group, class Callable, class Owner>
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 1531 of file SbeMessage.h.

◆ getGroup() [1/2]

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

Definition at line 1513 of file SbeMessage.h.

◆ getGroup() [2/2]

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

Definition at line 1521 of file SbeMessage.h.

◆ 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 1456 of file SbeMessage.h.

◆ 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 1464 of file SbeMessage.h.

◆ init()

group init ( entrySize )
protected

◆ 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 1482 of file SbeMessage.h.

◆ 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 1503 of file SbeMessage.h.

◆ schemaId()

SchemaId schemaId ( ) const
inlinenoexcept
Returns
SBE Schema ID.

Definition at line 1206 of file SbeMessage.h.

◆ setup()

group setup ( entryCount ,
messageTail ,
blockEnd()  )
protected

◆ setupGroup() [1/2]

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 1562 of file SbeMessage.h.

◆ setupGroup() [2/2]

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 1552 of file SbeMessage.h.

◆ 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 1439 of file SbeMessage.h.

◆ 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 1446 of file SbeMessage.h.

◆ setVariableLengthFieldToNull() [1/2]

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

Resets the variable length field.

Definition at line 1474 of file SbeMessage.h.

◆ 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 1493 of file SbeMessage.h.

◆ size_() [1/2]

MessageSize size_ ( size )
inline

Definition at line 1148 of file SbeMessage.h.

◆ size_() [2/2]

MessageSize NoCheck size_ ( size )
inline

Definition at line 1167 of file SbeMessage.h.

◆ templateId()

MessageTemplateId templateId ( ) const
inlinenoexcept
Returns
SBE Template identifier.

Definition at line 1190 of file SbeMessage.h.

◆ valid()

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

Definition at line 1184 of file SbeMessage.h.

◆ version()

SchemaVersion version ( ) const
inlinenoexcept
Returns
SBE Schema version.

Definition at line 1198 of file SbeMessage.h.

Member Data Documentation

◆ entryCount

Group::Size entryCount
protected

Definition at line 1335 of file SbeMessage.h.

◆ messageTail

Group::Size const void * messageTail
protected
Initial value:

Definition at line 1335 of file SbeMessage.h.

◆ noexcept [1/2]

MessageSize NoCheck noexcept

Definition at line 1165 of file SbeMessage.h.

◆ noexcept [2/2]

Group::EntrySize entrySize noexcept
protected
Initial value:
{
assert(group.valid())
assert(value.size()<=Size &&"The string is truncated.")

Definition at line 1326 of file SbeMessage.h.

◆ size

Definition at line 1146 of file SbeMessage.h.