pjmsg_mcap_wrapper
|
An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ZStandard-compressed buffer.
Definition at line 298 of file writer.hpp.
#include <writer.hpp>
Public Member Functions | |
ZStdWriter (CompressionLevel compressionLevel, uint64_t chunkSize) | |
~ZStdWriter () override | |
void | handleWrite (const std::byte *data, uint64_t size) override |
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. | |
uint64_t | size () const override |
Returns the size in bytes of the uncompressed data. | |
uint64_t | compressedSize () const override |
Returns the size in bytes of the compressed data. This will only be called after end() . | |
bool | empty () const override |
Returns true if write() has never been called since initialization or the last call to clear() . | |
void | handleClear () override |
const std::byte * | data () const override |
Returns a pointer to the uncompressed data. | |
const std::byte * | compressedData () const override |
Returns a pointer to the compressed data. This will only be called after end() . | |
void | clear () |
Clear the internal state of the writer, discarding any input or output buffers. | |
void | write (const std::byte *data, uint64_t size) |
Called whenever the writer needs to write data to the output MCAP file. | |
uint32_t | crc () |
Returns the CRC32 of the uncompressed data. | |
void | resetCrc () |
Resets the CRC32 calculation. | |
virtual void | flush () |
flushes any buffered data to the output. This is called by McapWriter after every completed chunk. Callers may also retain a reference to the writer and call flush() at their own cadence. Defaults to a no-op. | |
Public Attributes | |
bool | crcEnabled = false |
Private Attributes | |
std::vector< std::byte > | uncompressedBuffer_ |
std::vector< std::byte > | compressedBuffer_ |
ZSTD_CCtx_s * | zstdContext_ = nullptr |
uint32_t | crc_ |
mcap::ZStdWriter::ZStdWriter | ( | CompressionLevel | compressionLevel, |
uint64_t | chunkSize | ||
) |
Definition at line 244 of file writer.inl.
|
override |
Definition at line 251 of file writer.inl.
|
inherited |
Clear the internal state of the writer, discarding any input or output buffers.
Definition at line 107 of file writer.inl.
|
overridevirtual |
Returns a pointer to the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
Definition at line 295 of file writer.inl.
|
overridevirtual |
Returns the size in bytes of the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
Definition at line 278 of file writer.inl.
|
inherited |
Returns the CRC32 of the uncompressed data.
Definition at line 28 of file writer.inl.
|
overridevirtual |
Returns a pointer to the uncompressed data.
Implements mcap::IChunkWriter.
Definition at line 291 of file writer.inl.
|
overridevirtual |
Returns true if write()
has never been called since initialization or the last call to clear()
.
Implements mcap::IChunkWriter.
Definition at line 282 of file writer.inl.
|
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.
Definition at line 259 of file writer.inl.
|
inlinevirtualinherited |
flushes any buffered data to the output. This is called by McapWriter after every completed chunk. Callers may also retain a reference to the writer and call flush() at their own cadence. Defaults to a no-op.
Reimplemented in mcap::FileWriter, and mcap::StreamWriter.
Definition at line 153 of file writer.hpp.
|
overridevirtual |
Implements mcap::IChunkWriter.
Definition at line 286 of file writer.inl.
|
overridevirtual |
Implements mcap::IWritable.
Definition at line 255 of file writer.inl.
|
inherited |
Resets the CRC32 calculation.
Definition at line 36 of file writer.inl.
|
overridevirtual |
Returns the size in bytes of the uncompressed data.
Implements mcap::IChunkWriter.
Definition at line 274 of file writer.inl.
|
inherited |
Called whenever the writer needs to write data to the output MCAP file.
data | A pointer to the data to write. |
size | Size of the data in bytes. |
Definition at line 21 of file writer.inl.
|
private |
Definition at line 314 of file writer.hpp.
|
privateinherited |
Definition at line 159 of file writer.hpp.
|
inherited |
Definition at line 116 of file writer.hpp.
|
private |
Definition at line 313 of file writer.hpp.
|
private |
Definition at line 315 of file writer.hpp.