Public Member Functions | Private Attributes | List of all members
mcap::ZStdWriter Class Referencefinal

An in-memory IChunkWriter implementation that holds data in a temporary buffer before flushing to an ZStandard-compressed buffer. More...

#include <writer.hpp>

Inheritance diagram for mcap::ZStdWriter:
Inheritance graph
[legend]

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_szstdContext_ = nullptr
 

Additional Inherited Members

- Public Attributes inherited from mcap::IWritable
bool crcEnabled = false
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ZStdWriter()

mcap::ZStdWriter::ZStdWriter ( CompressionLevel  compressionLevel,
uint64_t  chunkSize 
)

◆ ~ZStdWriter()

mcap::ZStdWriter::~ZStdWriter ( )
override

Member Function Documentation

◆ compressedData()

const std::byte* mcap::ZStdWriter::compressedData ( ) const
overridevirtual

Returns a pointer to the compressed data. This will only be called after end().

Implements mcap::IChunkWriter.

◆ compressedSize()

uint64_t mcap::ZStdWriter::compressedSize ( ) const
overridevirtual

Returns the size in bytes of the compressed data. This will only be called after end().

Implements mcap::IChunkWriter.

◆ data()

const std::byte* mcap::ZStdWriter::data ( ) const
overridevirtual

Returns a pointer to the uncompressed data.

Implements mcap::IChunkWriter.

◆ empty()

bool mcap::ZStdWriter::empty ( ) const
overridevirtual

Returns true if write() has never been called since initialization or the last call to clear().

Implements mcap::IChunkWriter.

◆ end()

void mcap::ZStdWriter::end ( )
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.

◆ handleClear()

void mcap::ZStdWriter::handleClear ( )
overridevirtual

Implements mcap::IChunkWriter.

◆ handleWrite()

void mcap::ZStdWriter::handleWrite ( const std::byte *  data,
uint64_t  size 
)
overridevirtual

Implements mcap::IWritable.

◆ size()

uint64_t mcap::ZStdWriter::size ( ) const
overridevirtual

Returns the size in bytes of the uncompressed data.

Implements mcap::IChunkWriter.

Member Data Documentation

◆ compressedBuffer_

std::vector<std::byte> mcap::ZStdWriter::compressedBuffer_
private

Definition at line 297 of file writer.hpp.

◆ uncompressedBuffer_

std::vector<std::byte> mcap::ZStdWriter::uncompressedBuffer_
private

Definition at line 296 of file writer.hpp.

◆ zstdContext_

ZSTD_CCtx_s* mcap::ZStdWriter::zstdContext_ = nullptr
private

Definition at line 298 of file writer.hpp.


The documentation for this class was generated from the following file:


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:52