Public Member Functions | Protected Member Functions | List of all members
mcap::IChunkWriter Class Referenceabstract

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>

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

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~IChunkWriter()

virtual mcap::IChunkWriter::~IChunkWriter ( )
overridevirtualdefault

Member Function Documentation

◆ clear()

void mcap::IChunkWriter::clear ( )

Clear the internal state of the writer, discarding any input or output buffers.

◆ compressedData()

virtual const std::byte* mcap::IChunkWriter::compressedData ( ) const
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.

◆ compressedSize()

virtual uint64_t mcap::IChunkWriter::compressedSize ( ) const
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.

◆ data()

virtual const std::byte* mcap::IChunkWriter::data ( ) const
pure virtual

Returns a pointer to the uncompressed data.

Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.

◆ empty()

virtual bool mcap::IChunkWriter::empty ( ) const
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.

◆ end()

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

◆ handleClear()

virtual void mcap::IChunkWriter::handleClear ( )
protectedpure virtual

◆ size()

virtual uint64_t mcap::IChunkWriter::size ( ) const
overridepure virtual

Returns the size in bytes of the uncompressed data.

Implements mcap::IWritable.

Implemented in mcap::ZStdWriter, mcap::LZ4Writer, and mcap::BufferWriter.


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