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

Archetype: A channel within an MCAP file that defines how messages are structured and encoded. More...

#include <rerun/archetypes/mcap_channel.hpp>

Public Member Functions

 McapChannel (McapChannel &&other)=default
 
 McapChannel (const McapChannel &other)=default
 
McapChanneloperator= (const McapChannel &other)=default
 
McapChanneloperator= (McapChannel &&other)=default
 
 McapChannel (rerun::components::ChannelId _id, rerun::components::Text _topic, rerun::components::Text _message_encoding)
 
McapChannel with_id (const rerun::components::ChannelId &_id) &&
 Unique identifier for this channel within the MCAP file.
 
McapChannel with_many_id (const Collection< rerun::components::ChannelId > &_id) &&
 This method makes it possible to pack multiple id in a single component batch.
 
McapChannel with_topic (const rerun::components::Text &_topic) &&
 The topic name that this channel publishes to.
 
McapChannel with_many_topic (const Collection< rerun::components::Text > &_topic) &&
 This method makes it possible to pack multiple topic in a single component batch.
 
McapChannel with_message_encoding (const rerun::components::Text &_message_encoding) &&
 The encoding format used for messages in this channel.
 
McapChannel with_many_message_encoding (const Collection< rerun::components::Text > &_message_encoding) &&
 This method makes it possible to pack multiple message_encoding in a single component batch.
 
McapChannel with_metadata (const rerun::components::KeyValuePairs &_metadata) &&
 Additional metadata for this channel stored as key-value pairs.
 
McapChannel with_many_metadata (const Collection< rerun::components::KeyValuePairs > &_metadata) &&
 This method makes it possible to pack multiple metadata 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 McapChannel update_fields ()
 Update only some specific fields of a McapChannel.
 
static McapChannel clear_fields ()
 Clear all the fields of a McapChannel.
 

Public Attributes

std::optional< ComponentBatchid
 Unique identifier for this channel within the MCAP file.
 
std::optional< ComponentBatchtopic
 The topic name that this channel publishes to.
 
std::optional< ComponentBatchmessage_encoding
 The encoding format used for messages in this channel.
 
std::optional< ComponentBatchmetadata
 Additional metadata for this channel stored as key-value pairs.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.McapChannel"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_id
 ComponentDescriptor for the id field.
 
static constexpr auto Descriptor_topic
 ComponentDescriptor for the topic field.
 
static constexpr auto Descriptor_message_encoding
 ComponentDescriptor for the message_encoding field.
 
static constexpr auto Descriptor_metadata
 ComponentDescriptor for the metadata field.
 

Detailed Description

Archetype: A channel within an MCAP file that defines how messages are structured and encoded.

Channels in MCAP files group messages by topic and define their encoding format. Each channel has a unique identifier and specifies the message schema and encoding used for all messages published to that topic.

See also archetypes::McapMessage for individual messages within a channel, archetypes::McapSchema for the data structure definitions, 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()

McapChannel rerun::archetypes::McapChannel::with_id ( const rerun::components::ChannelId _id) &&
inline

Unique identifier for this channel within the MCAP file.

Channel IDs must be unique within a single MCAP file and are used to associate messages with their corresponding channel definition.

◆ with_many_id()

McapChannel rerun::archetypes::McapChannel::with_many_id ( const Collection< rerun::components::ChannelId > &  _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_topic()

McapChannel rerun::archetypes::McapChannel::with_topic ( const rerun::components::Text _topic) &&
inline

The topic name that this channel publishes to.

Topics are hierarchical paths from the original robotics system (e.g., "/sensors/camera/image") that categorize and organize different data streams. Topics are separate from Rerun's entity paths, but they often can be mapped to them.

◆ with_many_topic()

McapChannel rerun::archetypes::McapChannel::with_many_topic ( const Collection< rerun::components::Text > &  _topic) &&
inline

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

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

◆ with_message_encoding()

McapChannel rerun::archetypes::McapChannel::with_message_encoding ( const rerun::components::Text _message_encoding) &&
inline

The encoding format used for messages in this channel.

Common encodings include:

  • ros1 - ROS1 message format
  • cdr - Common Data Representation (CDR) message format, used by ROS2
  • protobuf - Protocol Buffers
  • json - JSON encoding

◆ with_many_message_encoding()

McapChannel rerun::archetypes::McapChannel::with_many_message_encoding ( const Collection< rerun::components::Text > &  _message_encoding) &&
inline

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

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

◆ with_metadata()

McapChannel rerun::archetypes::McapChannel::with_metadata ( const rerun::components::KeyValuePairs _metadata) &&
inline

Additional metadata for this channel stored as key-value pairs.

This can include channel-specific configuration, description, units, coordinate frames, or any other contextual information that helps interpret the data in this channel.

◆ with_many_metadata()

McapChannel rerun::archetypes::McapChannel::with_many_metadata ( const Collection< rerun::components::KeyValuePairs > &  _metadata) &&
inline

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

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

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::McapChannel::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::McapChannel::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::McapChannel::id

Unique identifier for this channel within the MCAP file.

Channel IDs must be unique within a single MCAP file and are used to associate messages with their corresponding channel definition.

◆ topic

std::optional<ComponentBatch> rerun::archetypes::McapChannel::topic

The topic name that this channel publishes to.

Topics are hierarchical paths from the original robotics system (e.g., "/sensors/camera/image") that categorize and organize different data streams. Topics are separate from Rerun's entity paths, but they often can be mapped to them.

◆ message_encoding

std::optional<ComponentBatch> rerun::archetypes::McapChannel::message_encoding

The encoding format used for messages in this channel.

Common encodings include:

  • ros1 - ROS1 message format
  • cdr - Common Data Representation (CDR) message format, used by ROS2
  • protobuf - Protocol Buffers
  • json - JSON encoding

◆ metadata

std::optional<ComponentBatch> rerun::archetypes::McapChannel::metadata

Additional metadata for this channel stored as key-value pairs.

This can include channel-specific configuration, description, units, coordinate frames, or any other contextual information that helps interpret the data in this channel.

◆ Descriptor_id

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

ComponentDescriptor for the id field.

◆ Descriptor_topic

constexpr auto rerun::archetypes::McapChannel::Descriptor_topic
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapChannel:topic", Loggable<rerun::components::Text>::ComponentType
)

ComponentDescriptor for the topic field.

◆ Descriptor_message_encoding

constexpr auto rerun::archetypes::McapChannel::Descriptor_message_encoding
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapChannel:message_encoding",
Loggable<rerun::components::Text>::ComponentType
)

ComponentDescriptor for the message_encoding field.

◆ Descriptor_metadata

constexpr auto rerun::archetypes::McapChannel::Descriptor_metadata
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "McapChannel:metadata",
Loggable<rerun::components::KeyValuePairs>::ComponentType
)

ComponentDescriptor for the metadata field.


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