17#define MCAP_LIBRARY_VERSION "2.1.0"
93 return sizeof(opcode) +
sizeof(dataSize) + dataSize;
122 : summaryStart(summaryStart)
123 , summaryOffsetStart(summaryOffsetStart)
143 , data{reinterpret_cast<const
std::byte*>(data.data()),
144 reinterpret_cast<const
std::byte*>(data.data() + data.size())} {}
171 , messageEncoding(messageEncoding)
173 , metadata(metadata) {}
283 4 + attachment.name.size() +
286 4 + attachment.mediaType.size() +
287 8 + attachment.dataSize +
289 , logTime(attachment.logTime)
290 , createTime(attachment.createTime)
291 , dataSize(attachment.dataSize)
292 , name(attachment.name)
293 , mediaType(attachment.mediaType) {}
363 , chunkOffset(chunkOffset_) {}
369 return !(*
this == other);
372 return ((*
this == other) || (*
this > other));
375 return !(*
this >= other);
378 return !(*
this > other);
399 , messageOffset(offset) {}
404#ifdef MCAP_IMPLEMENTATION
constexpr Timestamp MaxTime
constexpr uint64_t DefaultChunkSize
Compression
Supported MCAP compression algorithms.
constexpr ByteOffset EndOffset
constexpr char SpecVersion
constexpr char LibraryVersion[]
bool operator==(const LinearMessageView::Iterator &a, const LinearMessageView::Iterator &b)
CompressionLevel
Compression level to use when compression is enabled. Slower generally produces smaller files,...
MCAP_PUBLIC constexpr std::string_view OpCodeString(OpCode opcode)
Get the string representation of an OpCode.
constexpr uint8_t Magic[]
Attachment Index records are found in the Summary section, providing summary information for a single...
AttachmentIndex()=default
AttachmentIndex(const Attachment &attachment, ByteOffset fileOffset)
An Attachment is an arbitrary file embedded in an MCAP file, including a name, media type,...
Describes a Channel that messages are written to. A Channel represents a single connection from a pub...
std::string messageEncoding
Channel(const std::string_view topic, const std::string_view messageEncoding, SchemaId schemaId, const KeyValueMap &metadata={})
Chunk Index records are found in the Summary section, providing summary information for a single Chun...
Timestamp messageStartTime
ByteOffset chunkStartOffset
std::unordered_map< ChannelId, ByteOffset > messageIndexOffsets
ByteOffset messageIndexLength
ByteOffset compressedSize
ByteOffset uncompressedSize
An collection of Schemas, Channels, and Messages that supports compression and indexing.
ByteOffset uncompressedSize
ByteOffset compressedSize
Timestamp messageStartTime
The final record in the Data section, signaling the end of Data and beginning of Summary....
A list of timestamps to byte offsets for a single Channel. This record appears after each Chunk,...
std::vector< std::pair< Timestamp, ByteOffset > > records
Returned when iterating over Messages in a file, MessageView contains a reference to one Message,...
MessageView(const Message &message, const ChannelPtr channel, const SchemaPtr schema, RecordOffset offset)
const RecordOffset messageOffset
A single Message published to a Channel.
Timestamp logTime
Nanosecond timestamp when this message was recorded or received for recording.
uint32_t sequence
An optional sequence number. If non-zero, sequence numbers should be unique per channel and increasin...
Timestamp publishTime
Nanosecond timestamp when this message was initially published. If not available, this should be set ...
uint64_t dataSize
Size of the message payload in bytes, pointed to via data.
RecordOffset(ByteOffset offset_)
bool operator<(const RecordOffset &other) const
bool operator>=(const RecordOffset &other) const
bool operator<=(const RecordOffset &other) const
RecordOffset(ByteOffset offset_, ByteOffset chunkOffset_)
std::optional< ByteOffset > chunkOffset
bool operator!=(const RecordOffset &other) const
A generic Type-Length-Value record using a uint8 type and uint64 length. This is the generic form of ...
uint64_t recordSize() const
Describes a schema used for message encoding and decoding and/or describing the shape of messages....
Schema(const std::string_view name, const std::string_view encoding, const ByteArray &data)
Schema(const std::string_view name, const std::string_view encoding, const std::string_view data)
The Statistics record is found in the Summary section, providing counts and timestamp ranges for the ...
Timestamp messageStartTime
std::unordered_map< ChannelId, uint64_t > channelMessageCounts
Wraps a status code and string message carrying additional context.
Summary Offset records are found in the Summary Offset section. Records in the Summary section are gr...
#define MCAP_LIBRARY_VERSION