class IWritable


class IWritable { /* full declaration omitted */ };


An abstract interface for writing MCAP data.

Declared at: mcap/include/mcap/writer.hpp:112

Member Variables

public bool crcEnabled = false

Method Overview

  • public IWritable() noexcept
  • public uint32_t crc()
  • public virtual void end()
  • protected virtual void handleWrite(const std::byte * data, uint64_t size)
  • public void resetCrc()
  • public virtual uint64_t size() const
  • public void write(const std::byte * data, uint64_t size)
  • public virtual ~IWritable()


IWritable() noexcept

Declared at: mcap/include/mcap/writer.hpp:116

uint32_t crc()


Returns the CRC32 of the uncompressed data.

Declared at: mcap/include/mcap/writer.hpp:140

virtual void end()


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

Declared at: mcap/include/mcap/writer.hpp:131

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

Declared at: mcap/include/mcap/writer.hpp:147


const std::byte* data
uint64_t size

void resetCrc()


Resets the CRC32 calculation.

Declared at: mcap/include/mcap/writer.hpp:144

virtual uint64_t size() const


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

Declared at: mcap/include/mcap/writer.hpp:136

void write(const std::byte* data, uint64_t size)


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

Declared at: mcap/include/mcap/writer.hpp:126


const std::byte* data
A pointer to the data to write.
uint64_t size
Size of the data in bytes.

virtual ~IWritable()

Declared at: mcap/include/mcap/writer.hpp:117