pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mcap::ICompressedReader Class Referenceabstract

Detailed Description

An abstract interface for compressed readers.

Definition at line 109 of file reader.hpp.

#include <reader.hpp>

Inheritance diagram for mcap::ICompressedReader:
[legend]

Public Member Functions

virtual ~ICompressedReader () override=default
 
virtual void reset (const std::byte *data, uint64_t size, uint64_t uncompressedSize)=0
 Reset the reader state, clearing any internal buffers and state, and initialize with new compressed data.
 
virtual Status status () const =0
 Report the current status of decompression. A StatusCode other than StatusCode::Success after reset() is called indicates the decompression was not successful and the reader is in an invalid state.
 
virtual uint64_t size () const =0
 Returns the size of the file in bytes.
 
virtual uint64_t read (std::byte **output, uint64_t offset, uint64_t size)=0
 This method is called by MCAP reader classes when they need to read a portion of the file.
 

Constructor & Destructor Documentation

◆ ~ICompressedReader()

virtual mcap::ICompressedReader::~ICompressedReader ( )
overridevirtualdefault

Member Function Documentation

◆ read()

virtual uint64_t mcap::IReadable::read ( std::byte **  output,
uint64_t  offset,
uint64_t  size 
)
pure virtualinherited

This method is called by MCAP reader classes when they need to read a portion of the file.

Parameters
outputA pointer to a pointer to the buffer to write to. This method is expected to either maintain an internal buffer, read data into it, and update this pointer to point at the internal buffer, or update this pointer to point directly at the source data if possible. The pointer and data must remain valid and unmodified until the next call to read().
offsetThe offset in bytes from the beginning of the file to read.
sizeThe number of bytes to read.
Returns
uint64_t Number of bytes actually read. This may be less than the requested size if the end of the file is reached. The output pointer must be readable from output to output + size. If the read fails, this method should return 0.

Implemented in mcap::FileReader, mcap::FileStreamReader, mcap::BufferReader, mcap::ZStdReader, and mcap::LZ4Reader.

◆ reset()

virtual void mcap::ICompressedReader::reset ( const std::byte data,
uint64_t  size,
uint64_t  uncompressedSize 
)
pure virtual

Reset the reader state, clearing any internal buffers and state, and initialize with new compressed data.

Parameters
dataCompressed data to read from.
sizeSize of the compressed data in bytes.
uncompressedSizeSize of the data in bytes after decompression. A buffer of this size will be allocated for the uncompressed data.

Implemented in mcap::BufferReader, mcap::ZStdReader, and mcap::LZ4Reader.

◆ size()

virtual uint64_t mcap::IReadable::size ( ) const
pure virtualinherited

Returns the size of the file in bytes.

Returns
uint64_t The total number of bytes in the MCAP file.

Implemented in mcap::FileReader, mcap::FileStreamReader, mcap::BufferReader, mcap::ZStdReader, and mcap::LZ4Reader.

◆ status()

virtual Status mcap::ICompressedReader::status ( ) const
pure virtual

Report the current status of decompression. A StatusCode other than StatusCode::Success after reset() is called indicates the decompression was not successful and the reader is in an invalid state.

Implemented in mcap::BufferReader, mcap::ZStdReader, and mcap::LZ4Reader.


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