Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::McapSchema Struct Reference

Archetype: A schema definition that describes the structure of messages in an MCAP file. More...

#include <rerun/archetypes/mcap_schema.hpp>

Public Member Functions

 McapSchema (McapSchema &&other)=default
 
 McapSchema (const McapSchema &other)=default
 
McapSchemaoperator= (const McapSchema &other)=default
 
McapSchemaoperator= (McapSchema &&other)=default
 
 McapSchema (rerun::components::SchemaId _id, rerun::components::Text _name, rerun::components::Text _encoding, rerun::components::Blob _data)
 
McapSchema with_id (const rerun::components::SchemaId &_id) &&
 Unique identifier for this schema within the MCAP file.
 
McapSchema with_many_id (const Collection< rerun::components::SchemaId > &_id) &&
 This method makes it possible to pack multiple id in a single component batch.
 
McapSchema with_name (const rerun::components::Text &_name) &&
 Human-readable name identifying this schema.
 
McapSchema with_many_name (const Collection< rerun::components::Text > &_name) &&
 This method makes it possible to pack multiple name in a single component batch.
 
McapSchema with_encoding (const rerun::components::Text &_encoding) &&
 The schema definition format used to describe the message structure.
 
McapSchema with_many_encoding (const Collection< rerun::components::Text > &_encoding) &&
 This method makes it possible to pack multiple encoding in a single component batch.
 
McapSchema with_data (const rerun::components::Blob &_data) &&
 The schema definition content as binary data.
 
McapSchema with_many_data (const Collection< rerun::components::Blob > &_data) &&
 This method makes it possible to pack multiple data in a single component batch.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static McapSchema update_fields ()
 Update only some specific fields of a McapSchema.
 
static McapSchema clear_fields ()
 Clear all the fields of a McapSchema.
 

Public Attributes

std::optional< ComponentBatchid
 Unique identifier for this schema within the MCAP file.
 
std::optional< ComponentBatchname
 Human-readable name identifying this schema.
 
std::optional< ComponentBatchencoding
 The schema definition format used to describe the message structure.
 
std::optional< ComponentBatchdata
 The schema definition content as binary data.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.McapSchema"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_id
 ComponentDescriptor for the id field.
 
static constexpr auto Descriptor_name
 ComponentDescriptor for the name field.
 
static constexpr auto Descriptor_encoding
 ComponentDescriptor for the encoding field.
 
static constexpr auto Descriptor_data
 ComponentDescriptor for the data field.
 

Detailed Description

Archetype: A schema definition that describes the structure of messages in an MCAP file.

Schemas define the data types and field structures used by messages in MCAP channels. They provide the blueprint for interpreting message payloads, specifying field names, types, and organization. Each schema is referenced by channels to indicate how their messages should be decoded and understood.

See also archetypes::McapChannel for channels that reference these schemas, archetypes::McapMessage for the messages that conform to these schemas, and the MCAP specification for complete format details.

This type is unstable and may change significantly in a way that the data won't be backwards compatible.

Member Function Documentation

◆ with_id()

McapSchema rerun::archetypes::McapSchema::with_id ( const rerun::components::SchemaId _id) &&
inline

Unique identifier for this schema within the MCAP file.

Schema IDs must be unique within an MCAP file and are referenced by channels to specify their message structure. A single schema can be shared across multiple channels.

◆ with_many_id()

McapSchema rerun::archetypes::McapSchema::with_many_id ( const Collection< rerun::components::SchemaId > &  _id) &&
inline

This method makes it possible to pack multiple id in a single component batch.

This only makes sense when used in conjunction with columns. with_id should be used when logging a single row's worth of data.

◆ with_name()

McapSchema rerun::archetypes::McapSchema::with_name ( const rerun::components::Text _name) &&
inline

Human-readable name identifying this schema.

Schema names typically describe the message type or data structure (e.g., "geometry_msgs/msg/Twist", "sensor_msgs/msg/Image", "MyCustomMessage").

◆ with_many_name()

McapSchema rerun::archetypes::McapSchema::with_many_name ( const Collection< rerun::components::Text > &  _name) &&
inline

This method makes it possible to pack multiple name in a single component batch.

This only makes sense when used in conjunction with columns. with_name should be used when logging a single row's worth of data.

◆ with_encoding()

McapSchema rerun::archetypes::McapSchema::with_encoding ( const rerun::components::Text _encoding) &&
inline

The schema definition format used to describe the message structure.

Common schema encodings include:

◆ with_many_encoding()

McapSchema rerun::archetypes::McapSchema::with_many_encoding ( const Collection< rerun::components::Text > &  _encoding) &&
inline

This method makes it possible to pack multiple encoding in a single component batch.

This only makes sense when used in conjunction with columns. with_encoding should be used when logging a single row's worth of data.

◆ with_data()

McapSchema rerun::archetypes::McapSchema::with_data ( const rerun::components::Blob _data) &&
inline

The schema definition content as binary data.

This contains the actual schema specification in the format indicated by the encoding field. For text-based schemas (like ROS message definitions or JSON Schema), this is typically UTF-8 encoded text. For binary schema formats, this contains the serialized schema data.

◆ with_many_data()

McapSchema rerun::archetypes::McapSchema::with_many_data ( const Collection< rerun::components::Blob > &  _data) &&
inline

This method makes it possible to pack multiple data in a single component batch.

This only makes sense when used in conjunction with columns. with_data should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::McapSchema::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::McapSchema::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ id

std::optional<ComponentBatch> rerun::archetypes::McapSchema::id

Unique identifier for this schema within the MCAP file.

Schema IDs must be unique within an MCAP file and are referenced by channels to specify their message structure. A single schema can be shared across multiple channels.

◆ name

std::optional<ComponentBatch> rerun::archetypes::McapSchema::name

Human-readable name identifying this schema.

Schema names typically describe the message type or data structure (e.g., "geometry_msgs/msg/Twist", "sensor_msgs/msg/Image", "MyCustomMessage").

◆ encoding

std::optional<ComponentBatch> rerun::archetypes::McapSchema::encoding

The schema definition format used to describe the message structure.

Common schema encodings include:

◆ data

std::optional<ComponentBatch> rerun::archetypes::McapSchema::data

The schema definition content as binary data.

This contains the actual schema specification in the format indicated by the encoding field. For text-based schemas (like ROS message definitions or JSON Schema), this is typically UTF-8 encoded text. For binary schema formats, this contains the serialized schema data.

◆ Descriptor_id

constexpr auto rerun::archetypes::McapSchema::Descriptor_id
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapSchema:id", Loggable<rerun::components::SchemaId>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition mcap_schema.hpp:66

ComponentDescriptor for the id field.

◆ Descriptor_name

constexpr auto rerun::archetypes::McapSchema::Descriptor_name
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapSchema:name", Loggable<rerun::components::Text>::ComponentType
)

ComponentDescriptor for the name field.

◆ Descriptor_encoding

constexpr auto rerun::archetypes::McapSchema::Descriptor_encoding
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapSchema:encoding", Loggable<rerun::components::Text>::ComponentType
)

ComponentDescriptor for the encoding field.

◆ Descriptor_data

constexpr auto rerun::archetypes::McapSchema::Descriptor_data
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapSchema:data", Loggable<rerun::components::Blob>::ComponentType
)

ComponentDescriptor for the data field.


The documentation for this struct was generated from the following file: