pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
mcap::IWritable Class Referenceabstract

Detailed Description

An abstract interface for writing MCAP data.

Definition at line 114 of file writer.hpp.

#include <writer.hpp>

Inheritance diagram for mcap::IWritable:
[legend]

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_
 

Constructor & Destructor Documentation

◆ IWritable()

mcap::IWritable::IWritable ( )
noexcept

Definition at line 18 of file writer.inl.

◆ ~IWritable()

virtual mcap::IWritable::~IWritable ( )
virtualdefault

Member Function Documentation

◆ crc()

uint32_t mcap::IWritable::crc ( )

Returns the CRC32 of the uncompressed data.

Definition at line 28 of file writer.inl.

◆ end()

virtual void mcap::IWritable::end ( )
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.

◆ flush()

virtual void mcap::IWritable::flush ( )
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.

◆ handleWrite()

virtual void mcap::IWritable::handleWrite ( const std::byte data,
uint64_t  size 
)
protectedpure virtual

◆ resetCrc()

void mcap::IWritable::resetCrc ( )

Resets the CRC32 calculation.

Definition at line 36 of file writer.inl.

◆ size()

virtual uint64_t mcap::IWritable::size ( ) const
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.

◆ write()

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

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

Parameters
dataA pointer to the data to write.
sizeSize of the data in bytes.

Definition at line 21 of file writer.inl.

Member Data Documentation

◆ crc_

uint32_t mcap::IWritable::crc_
private

Definition at line 159 of file writer.hpp.

◆ crcEnabled

bool mcap::IWritable::crcEnabled = false

Definition at line 116 of file writer.hpp.


The documentation for this class was generated from the following files: