pjmsg_mcap_wrapper
|
An in-memory IChunkWriter implementation backed by a growable buffer.
Definition at line 253 of file writer.hpp.
#include <writer.hpp>
Public Member Functions | |
void | handleWrite (const std::byte *data, uint64_t size) override |
void | end () override |
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. | |
uint64_t | size () const override |
Returns the size in bytes of the uncompressed data. | |
uint64_t | compressedSize () const override |
Returns the size in bytes of the compressed data. This will only be called after end() . | |
bool | empty () const override |
Returns true if write() has never been called since initialization or the last call to clear() . | |
void | handleClear () override |
const std::byte * | data () const override |
Returns a pointer to the uncompressed data. | |
const std::byte * | compressedData () const override |
Returns a pointer to the compressed data. This will only be called after end() . | |
void | clear () |
Clear the internal state of the writer, discarding any input or output buffers. | |
void | write (const std::byte *data, uint64_t size) |
Called whenever the writer needs to write data to the output MCAP file. | |
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 |
Private Attributes | |
std::vector< std::byte > | buffer_ |
uint32_t | crc_ |
|
inherited |
Clear the internal state of the writer, discarding any input or output buffers.
Definition at line 107 of file writer.inl.
|
overridevirtual |
Returns a pointer to the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
Definition at line 142 of file writer.inl.
|
overridevirtual |
Returns the size in bytes of the compressed data. This will only be called after end()
.
Implements mcap::IChunkWriter.
Definition at line 126 of file writer.inl.
|
inherited |
Returns the CRC32 of the uncompressed data.
Definition at line 28 of file writer.inl.
|
overridevirtual |
Returns a pointer to the uncompressed data.
Implements mcap::IChunkWriter.
Definition at line 138 of file writer.inl.
|
overridevirtual |
Returns true if write()
has never been called since initialization or the last call to clear()
.
Implements mcap::IChunkWriter.
Definition at line 130 of file writer.inl.
|
overridevirtual |
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::IChunkWriter.
Definition at line 118 of file writer.inl.
|
inlinevirtualinherited |
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.
|
overridevirtual |
Implements mcap::IChunkWriter.
Definition at line 134 of file writer.inl.
|
overridevirtual |
Implements mcap::IWritable.
Definition at line 114 of file writer.inl.
|
inherited |
Resets the CRC32 calculation.
Definition at line 36 of file writer.inl.
|
overridevirtual |
Returns the size in bytes of the uncompressed data.
Implements mcap::IChunkWriter.
Definition at line 122 of file writer.inl.
|
inherited |
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 265 of file writer.hpp.
|
privateinherited |
Definition at line 159 of file writer.hpp.
|
inherited |
Definition at line 116 of file writer.hpp.