Go to the documentation of this file.
8 #include <unordered_set>
23 bool noChunkCRC =
false;
27 bool noAttachmentCRC =
false;
31 bool enableDataCRC =
false;
35 bool noSummaryCRC =
false;
40 bool noChunking =
false;
46 bool noMessageIndex =
false;
54 bool noSummary =
false;
79 bool forceCompression =
false;
95 bool noRepeatedSchemas =
false;
96 bool noRepeatedChannels =
false;
97 bool noAttachmentIndex =
false;
98 bool noMetadataIndex =
false;
99 bool noChunkIndex =
false;
100 bool noStatistics =
false;
101 bool noSummaryOffsets =
false;
104 : profile(profile) {}
112 bool crcEnabled =
false;
129 virtual
void end() = 0;
134 virtual uint64_t
size() const = 0;
145 virtual
void handleWrite(const
std::
byte*
data, uint64_t
size) = 0;
161 void handleWrite(
const std::byte*
data, uint64_t
size)
override;
163 uint64_t
size()
const override;
166 std::FILE* file_ =
nullptr;
178 void handleWrite(
const std::byte*
data, uint64_t
size)
override;
180 uint64_t
size()
const override;
201 virtual void end()
override = 0;
205 virtual uint64_t
size()
const override = 0;
215 virtual bool empty()
const = 0;
224 virtual const std::byte*
data()
const = 0;
229 virtual const std::byte* compressedData()
const = 0;
232 virtual void handleClear() = 0;
241 void handleWrite(
const std::byte*
data, uint64_t
size)
override;
243 uint64_t
size()
const override;
245 bool empty()
const override;
246 void handleClear()
override;
247 const std::byte*
data()
const override;
248 const std::byte* compressedData()
const override;
262 void handleWrite(
const std::byte*
data, uint64_t
size)
override;
264 uint64_t
size()
const override;
266 bool empty()
const override;
267 void handleClear()
override;
268 const std::byte*
data()
const override;
269 const std::byte* compressedData()
const override;
286 void handleWrite(
const std::byte*
data, uint64_t
size)
override;
288 uint64_t
size()
const override;
290 bool empty()
const override;
291 void handleClear()
override;
292 const std::byte*
data()
const override;
293 const std::byte* compressedData()
const override;
354 void addSchema(
Schema& schema);
364 void addChannel(
Channel& channel);
407 void closeLastChunk();
461 uint64_t uncompressedSize_ = 0;
462 bool opened_ =
false;
471 #ifdef MCAP_IMPLEMENTATION
472 # include "writer.inl"
std::vector< MetadataIndex > metadataIndex_
std::vector< AttachmentIndex > attachmentIndex_
std::string profile
The recording profile. See https://mcap.dev/spec/registry#well-known-profiles for more information on...
An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ...
Compression
Supported MCAP compression algorithms.
std::vector< std::byte > ByteArray
std::unique_ptr< ZStdWriter > zstdChunk_
std::unique_ptr< FileWriter > fileOutput_
Wraps a status code and string message carrying additional context.
std::vector< Schema > schemas_
std::unique_ptr< LZ4Writer > lz4Chunk_
std::vector< std::byte > buffer_
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Implements the IWritable interface used by McapWriter by wrapping a std::ostream stream.
Chunk Index records are found in the Summary section, providing summary information for a single Chun...
constexpr Timestamp MaxTime
static int writer(lua_State *L, const void *b, size_t size, void *ud)
std::unique_ptr< StreamWriter > streamOutput_
An collection of Schemas, Channels, and Messages that supports compression and indexing.
std::unique_ptr< BufferWriter > uncompressedChunk_
span_constexpr std::size_t size(span< T, Extent > const &spn)
void clear(lua_State *L, int table_index)
An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ...
static const char * output
Summary Offset records are found in the Summary Offset section. Records in the Summary section are gr...
Describes a Channel that messages are written to. A Channel represents a single connection from a pub...
An abstract interface for writing Chunk data. Chunk data is buffered in memory and written to disk as...
std::unordered_set< SchemaId > writtenSchemas_
#define MCAP_LIBRARY_VERSION
std::vector< ChunkIndex > chunkIndex_
std::vector< std::byte > uncompressedBuffer_
An Attachment is an arbitrary file embedded in an MCAP file, including a name, media type,...
std::vector< Channel > channels_
CompressionLevel
Compression level to use when compression is enabled. Slower generally produces smaller files,...
std::unordered_map< ChannelId, MessageIndex > currentMessageIndex_
basic_string_view< char > string_view
char int int compressionLevel
McapWriterOptions(const std::string_view profile)
Provides a write interface to an MCAP file.
std::vector< std::byte > compressedBuffer_
The Statistics record is found in the Summary section, providing counts and timestamp ranges for the ...
A single Message published to a Channel.
constexpr uint64_t DefaultChunkSize
A generic Type-Length-Value record using a uint8 type and uint64 length. This is the generic form of ...
An abstract interface for writing MCAP data.
std::vector< std::byte > uncompressedBuffer_
A list of timestamps to byte offsets for a single Channel. This record appears after each Chunk,...
The final record in the Data section, signaling the end of Data and beginning of Summary....
Describes a schema used for message encoding and decoding and/or describing the shape of messages....
std::unordered_map< std::string, std::string > KeyValueMap
Attachment Index records are found in the Summary section, providing summary information for a single...
std::vector< std::byte > compressedBuffer_
Implements the IWritable interface used by McapWriter by wrapping a FILE* pointer created by fopen().
CompressionLevel compressionLevel_
Configuration options for McapWriter.
An in-memory IChunkWriter implementation backed by a growable buffer.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:48