Struct Attachment

Struct Documentation

struct Attachment

An attachment to store in an MCAP file.

Attachments are arbitrary binary data that can be stored alongside messages. Common uses include storing configuration files, calibration data, or other reference material related to the recording.

Public Members

uint64_t log_time = 0

Timestamp at which the attachment was recorded, in nanoseconds since epoch.

uint64_t create_time = 0

Timestamp at which the attachment was created, in nanoseconds since epoch. If not available, set to 0.

std::string_view name

Name of the attachment, e.g. “config.json”.

std::string_view media_type

Media type of the attachment, e.g. “application/json”.

const std::byte *data = nullptr

Pointer to the attachment data.

size_t data_len = 0

Length of the attachment data in bytes.