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

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

#include <writer.hpp>

Inheritance diagram for mcap::LZ4Writer:
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
 
 LZ4Writer (CompressionLevel compressionLevel, uint64_t chunkSize)
 
uint64_t size () const override
 Returns the size in bytes of the uncompressed data. More...
 
- 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_
 
CompressionLevel compressionLevel_
 
std::vector< std::byte > uncompressedBuffer_
 

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 LZ4-compressed buffer.

Definition at line 258 of file writer.hpp.

Constructor & Destructor Documentation

◆ LZ4Writer()

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

Member Function Documentation

◆ compressedData()

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

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

Implements mcap::IChunkWriter.

◆ compressedSize()

uint64_t mcap::LZ4Writer::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::LZ4Writer::data ( ) const
overridevirtual

Returns a pointer to the uncompressed data.

Implements mcap::IChunkWriter.

◆ empty()

bool mcap::LZ4Writer::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::LZ4Writer::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::LZ4Writer::handleClear ( )
overridevirtual

Implements mcap::IChunkWriter.

◆ handleWrite()

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

Implements mcap::IWritable.

◆ size()

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

Returns the size in bytes of the uncompressed data.

Implements mcap::IChunkWriter.

Member Data Documentation

◆ compressedBuffer_

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

Definition at line 273 of file writer.hpp.

◆ compressionLevel_

CompressionLevel mcap::LZ4Writer::compressionLevel_
private

Definition at line 274 of file writer.hpp.

◆ uncompressedBuffer_

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

Definition at line 272 of file writer.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:31