Class IChunkWriter
Defined in File writer.hpp
Inheritance Relationships
Base Type
public mcap::IWritable(Class IWritable)
Derived Types
public mcap::BufferWriter(Class BufferWriter)public mcap::LZ4Writer(Class LZ4Writer)public mcap::ZStdWriter(Class ZStdWriter)
Class Documentation
-
class IChunkWriter : public mcap::IWritable
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.
Subclassed by mcap::BufferWriter, mcap::LZ4Writer, mcap::ZStdWriter
Public Functions
-
virtual ~IChunkWriter() override = default
-
virtual void end() override = 0
Called when the writer wants to close the current output Chunk. After this call,
data()andsize()should return the data and size of the compressed data.
-
virtual uint64_t size() const override = 0
Returns the size in bytes of the uncompressed data.
-
virtual uint64_t compressedSize() const = 0
Returns the size in bytes of the compressed data. This will only be called after
end().
-
virtual bool empty() const = 0
Returns true if
write()has never been called since initialization or the last call toclear().
-
void clear()
Clear the internal state of the writer, discarding any input or output buffers.
-
virtual const std::byte *data() const = 0
Returns a pointer to the uncompressed data.
Protected Functions
-
virtual void handleClear() = 0
-
virtual ~IChunkWriter() override = default