An abstract interface for writing Chunk data. Chunk data is buffered in memory and written to disk as a single record, to support optimal compression and calculating the final Chunk data size. More...
#include <writer.hpp>
Public Member Functions | |
void | clear () |
Clear the internal state of the writer, discarding any input or output buffers. More... | |
virtual const std::byte * | compressedData () const =0 |
Returns a pointer to the compressed data. This will only be called after end() . More... | |
virtual uint64_t | compressedSize () const =0 |
Returns the size in bytes of the compressed data. This will only be called after end() . More... | |
virtual const std::byte * | data () const =0 |
Returns a pointer to the uncompressed data. More... | |
virtual bool | empty () const =0 |
Returns true if write() has never been called since initialization or the last call to clear() . More... | |
virtual void | end () override=0 |
Called when the writer wants to close the current output Chunk. After this call, data() and size() should return the data and size of the compressed data. More... | |
virtual uint64_t | size () const override=0 |
Returns the size in bytes of the uncompressed data. More... | |
virtual | ~IChunkWriter () override=default |
Public Member Functions inherited from mcap::IWritable | |
uint32_t | crc () |
Returns the CRC32 of the uncompressed data. More... | |
IWritable () noexcept | |
void | resetCrc () |
Resets the CRC32 calculation. More... | |
void | write (const std::byte *data, uint64_t size) |
Called whenever the writer needs to write data to the output MCAP file. More... | |
virtual | ~IWritable ()=default |
Protected Member Functions | |
virtual void | handleClear ()=0 |
Protected Member Functions inherited from mcap::IWritable | |
virtual void | handleWrite (const std::byte *data, uint64_t size)=0 |
Additional Inherited Members | |
Public Attributes inherited from mcap::IWritable | |
bool | crcEnabled = false |
An abstract interface for writing Chunk data. Chunk data is buffered in memory and written to disk as a single record, to support optimal compression and calculating the final Chunk data size.
Definition at line 192 of file writer.hpp.
|
overridevirtualdefault |
void mcap::IChunkWriter::clear | ( | ) |
Clear the internal state of the writer, discarding any input or output buffers.
|
pure virtual |
Returns a pointer to the compressed data. This will only be called after end()
.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
pure virtual |
Returns the size in bytes of the compressed data. This will only be called after end()
.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
pure virtual |
Returns a pointer to the uncompressed data.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
pure virtual |
Returns true if write()
has never been called since initialization or the last call to clear()
.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
overridepure virtual |
Called when the writer wants to close the current output Chunk. After this call, data()
and size()
should return the data and size of the compressed data.
Implements mcap::IWritable.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
protectedpure virtual |
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.
|
overridepure virtual |
Returns the size in bytes of the uncompressed data.
Implements mcap::IWritable.
Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.