Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
mcap::IWritable Class Referenceabstract

An abstract interface for writing MCAP data. More...

#include <writer.hpp>

Inheritance diagram for mcap::IWritable:
Inheritance graph
[legend]

Public Member Functions

uint32_t crc ()
 Returns the CRC32 of the uncompressed data. More...
 
virtual void end ()=0
 Called when the writer is finished writing data to the output MCAP file. More...
 
 IWritable () noexcept
 
void resetCrc ()
 Resets the CRC32 calculation. More...
 
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(). More...
 
void write (const std::byte *data, uint64_t size)
 Called whenever the writer needs to write data to the output MCAP file. More...
 
virtual ~IWritable ()=default
 

Public Attributes

bool crcEnabled = false
 

Protected Member Functions

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

Private Attributes

uint32_t crc_
 

Detailed Description

An abstract interface for writing MCAP data.

Definition at line 110 of file writer.hpp.

Constructor & Destructor Documentation

◆ IWritable()

mcap::IWritable::IWritable ( )
noexcept

◆ ~IWritable()

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

Member Function Documentation

◆ crc()

uint32_t mcap::IWritable::crc ( )

Returns the CRC32 of the uncompressed data.

◆ end()

virtual void mcap::IWritable::end ( )
pure virtual

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

Implemented in mcap::IChunkWriter, mcap::ZStdWriter, mcap::LZ4Writer, mcap::BufferWriter, mcap::StreamWriter, and mcap::FileWriter.

◆ handleWrite()

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

◆ resetCrc()

void mcap::IWritable::resetCrc ( )

Resets the CRC32 calculation.

◆ 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::IChunkWriter, mcap::ZStdWriter, mcap::LZ4Writer, mcap::BufferWriter, mcap::StreamWriter, and mcap::FileWriter.

◆ 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.

Member Data Documentation

◆ crc_

uint32_t mcap::IWritable::crc_
private

Definition at line 148 of file writer.hpp.

◆ crcEnabled

bool mcap::IWritable::crcEnabled = false

Definition at line 112 of file writer.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:52