Rerun C++ SDK
|
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 | |
McapSchema & | operator= (const McapSchema &other)=default |
McapSchema & | operator= (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< ComponentColumn > | columns (const Collection< uint32_t > &lengths_) |
Partitions the component data into multiple sub-batches. | |
Collection< ComponentColumn > | columns () |
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< ComponentBatch > | id |
Unique identifier for this schema within the MCAP file. | |
std::optional< ComponentBatch > | name |
Human-readable name identifying this schema. | |
std::optional< ComponentBatch > | encoding |
The schema definition format used to describe the message structure. | |
std::optional< ComponentBatch > | data |
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 ComponentDescriptor s. | |
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. | |
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.
|
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.
|
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.
|
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"
).
|
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.
|
inline |
The schema definition format used to describe the message structure.
Common schema encodings include:
protobuf
- Protocol Buffers schema definitionros1msg
- ROS1 message definition formatros2msg
- ROS2 message definition formatjsonschema
- JSON Schema specificationflatbuffer
- FlatBuffers schema definition
|
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.
|
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.
|
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.
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 ComponentColumn
s 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.
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.
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.
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"
).
std::optional<ComponentBatch> rerun::archetypes::McapSchema::encoding |
The schema definition format used to describe the message structure.
Common schema encodings include:
protobuf
- Protocol Buffers schema definitionros1msg
- ROS1 message definition formatros2msg
- ROS2 message definition formatjsonschema
- JSON Schema specificationflatbuffer
- FlatBuffers schema definition 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.
|
staticconstexpr |
ComponentDescriptor
for the id
field.
|
staticconstexpr |
ComponentDescriptor
for the name
field.
|
staticconstexpr |
ComponentDescriptor
for the encoding
field.
|
staticconstexpr |
ComponentDescriptor
for the data
field.