sbepp
|
Provides various traits/attributes of a <message>
element.
More...
Public Types | |
template<typename Byte > | |
using | value_type = MessageType<Byte> |
Representation type. | |
using | schema_tag = SchemaTag |
Schema tag. | |
Static Public Member Functions | |
static constexpr const char * | name () noexcept |
Returns name attribute. | |
static constexpr const char * | description () noexcept |
Returns description attribute. | |
static constexpr message_id_t | id () noexcept |
Returns id attribute. | |
static constexpr block_length_t | block_length () noexcept |
Returns blockLength attribute. | |
static constexpr const char * | semantic_type () noexcept |
Returns semanticType attribute. | |
static constexpr version_t | since_version () noexcept |
Returns addedSince attribute. | |
static constexpr version_t | deprecated () noexcept |
Returns deprecated attribute. Available only if provided in schema. | |
static constexpr std::size_t | size_bytes (...) noexcept |
Returns number of bytes required to represent the message in given configuration. | |
Provides various traits/attributes of a <message>
element.
For example: sbepp::message_traits<market_schema::schema::messages::msg1>::name();
T | message tag |
using sbepp::message_traits< T >::value_type = MessageType<Byte> |
Representation type.
Byte | byte type |
|
staticconstexprnoexcept |
Returns number of bytes required to represent the message in given configuration.
... | parameter list depends on the message structure |
Parameter list is built as follows:
<group>
within the message, in a top-to-bottom order, there will be a parameter in form of NumInGroupType <group_path>_num_in_group[_<n>]
where <group_path>
is built like <parent_group_path>_<child_group_name>
. Optional _<n>
part is added to disambiguate names that otherwise would be the same. This parameter represents the total number of group entries (even if they are spread across multiple enclosing group entries).<data>
member on any level within the message, there will be additional std::size_t total_data_size
parameter at the end of parameter list, representing the total payload size from all the <data>
elements within the message.Here's the example with different cases:
For usage example, see Estimating buffer size to encode a message.