An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ZStandard-compressed buffer. More...
#include <writer.hpp>
Public Member Functions | |
const std::byte * | compressedData () const override |
Returns a pointer to the compressed data. This will only be called after end() . More... | |
uint64_t | compressedSize () const override |
Returns the size in bytes of the compressed data. This will only be called after end() . More... | |
const std::byte * | data () const override |
Returns a pointer to the uncompressed data. More... | |
bool | empty () const override |
Returns true if write() has never been called since initialization or the last call to clear() . More... | |
void | end () override |
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... | |
void | handleClear () override |
void | handleWrite (const std::byte *data, uint64_t size) override |
uint64_t | size () const override |
Returns the size in bytes of the uncompressed data. More... | |
ZStdWriter (CompressionLevel compressionLevel, uint64_t chunkSize) | |
~ZStdWriter () override | |
Public Member Functions inherited from mcap::IChunkWriter | |
void | clear () |
Clear the internal state of the writer, discarding any input or output buffers. 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 |
Private Attributes | |
std::vector< std::byte > | compressedBuffer_ |
std::vector< std::byte > | uncompressedBuffer_ |
ZSTD_CCtx_s * | zstdContext_ = nullptr |
Additional Inherited Members | |
Public Attributes inherited from mcap::IWritable | |
bool | crcEnabled = false |
An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ZStandard-compressed buffer.
Definition at line 281 of file writer.hpp.
mcap::ZStdWriter::ZStdWriter | ( | CompressionLevel | compressionLevel, |
uint64_t | chunkSize | ||
) |
|
override |
|
overridevirtual |
Returns a pointer to the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
|
overridevirtual |
Returns the size in bytes of the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
|
overridevirtual |
Returns a pointer to the uncompressed data.
Implements mcap::IChunkWriter.
|
overridevirtual |
Returns true if write()
has never been called since initialization or the last call to clear()
.
Implements mcap::IChunkWriter.
|
overridevirtual |
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::IChunkWriter.
|
overridevirtual |
Implements mcap::IChunkWriter.
|
overridevirtual |
Implements mcap::IWritable.
|
overridevirtual |
Returns the size in bytes of the uncompressed data.
Implements mcap::IChunkWriter.
|
private |
Definition at line 297 of file writer.hpp.
|
private |
Definition at line 296 of file writer.hpp.
|
private |
Definition at line 298 of file writer.hpp.