Public Member Functions | List of all members
mcap::IReadable Struct Referenceabstract

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

#include <reader.hpp>

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

Public Member Functions

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. More...
 
virtual uint64_t size () const =0
 Returns the size of the file in bytes. More...
 
virtual ~IReadable ()=default
 

Detailed Description

An abstract interface for reading MCAP data.

Definition at line 43 of file reader.hpp.

Constructor & Destructor Documentation

◆ ~IReadable()

virtual mcap::IReadable::~IReadable ( )
virtualdefault

Member Function Documentation

◆ read()

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

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::LZ4Reader, mcap::ZStdReader, mcap::BufferReader, mcap::FileStreamReader, and mcap::FileReader.

◆ size()

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

Returns the size of the file in bytes.

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

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


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


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