Class IWritable

Inheritance Relationships

Derived Types

Class Documentation

class IWritable

An abstract interface for writing MCAP data.

Subclassed by mcap::FileWriter, mcap::IChunkWriter, mcap::StreamWriter

Public Functions

IWritable() noexcept
virtual ~IWritable() = default
void write(const std::byte *data, uint64_t size)

Called whenever the writer needs to write data to the output MCAP file.

Parameters:
  • data – A pointer to the data to write.

  • size – Size of the data in bytes.

virtual void end() = 0

Called when the writer is finished writing data to the output MCAP file.

virtual uint64_t size() const = 0

Returns the current size of the file in bytes. This must be equal to the sum of all size parameters passed to write().

uint32_t crc()

Returns the CRC32 of the uncompressed data.

void resetCrc()

Resets the CRC32 calculation.

Public Members

bool crcEnabled = false

Protected Functions

virtual void handleWrite(const std::byte *data, uint64_t size) = 0