pjmsg_mcap_wrapper
|
An abstract interface for writing MCAP data.
Definition at line 114 of file writer.hpp.
#include <writer.hpp>
Public Member 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. | |
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. | |
virtual void | flush () |
flushes any buffered data to the output. This is called by McapWriter after every completed chunk. Callers may also retain a reference to the writer and call flush() at their own cadence. Defaults to a no-op. | |
Public Attributes | |
bool | crcEnabled = false |
Protected Member Functions | |
virtual void | handleWrite (const std::byte *data, uint64_t size)=0 |
Private Attributes | |
uint32_t | crc_ |
|
noexcept |
Definition at line 18 of file writer.inl.
|
virtualdefault |
uint32_t mcap::IWritable::crc | ( | ) |
Returns the CRC32 of the uncompressed data.
Definition at line 28 of file writer.inl.
|
pure virtual |
Called when the writer is finished writing data to the output MCAP file.
Implemented in mcap::FileWriter, mcap::StreamWriter, mcap::BufferWriter, mcap::LZ4Writer, mcap::ZStdWriter, and mcap::IChunkWriter.
|
inlinevirtual |
flushes any buffered data to the output. This is called by McapWriter after every completed chunk. Callers may also retain a reference to the writer and call flush() at their own cadence. Defaults to a no-op.
Reimplemented in mcap::FileWriter, and mcap::StreamWriter.
Definition at line 153 of file writer.hpp.
|
protectedpure virtual |
Implemented in mcap::FileWriter, mcap::StreamWriter, mcap::BufferWriter, mcap::LZ4Writer, and mcap::ZStdWriter.
void mcap::IWritable::resetCrc | ( | ) |
Resets the CRC32 calculation.
Definition at line 36 of file writer.inl.
|
pure virtual |
Returns the current size of the file in bytes. This must be equal to the sum of all size
parameters passed to write()
.
Implemented in mcap::FileWriter, mcap::StreamWriter, mcap::BufferWriter, mcap::LZ4Writer, mcap::ZStdWriter, and mcap::IChunkWriter.
void mcap::IWritable::write | ( | const std::byte * | data, |
uint64_t | size | ||
) |
Called whenever the writer needs to write data to the output MCAP file.
data | A pointer to the data to write. |
size | Size of the data in bytes. |
Definition at line 21 of file writer.inl.
|
private |
Definition at line 159 of file writer.hpp.
bool mcap::IWritable::crcEnabled = false |
Definition at line 116 of file writer.hpp.