Public Member Functions | Private Attributes | List of all members
mcap::BufferReader Class Referencefinal

A "null" compressed reader that directly passes through uncompressed data. No internal buffers are allocated. More...

#include <reader.hpp>

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

Public Member Functions

 BufferReader ()=default
 
 BufferReader (BufferReader &&)=delete
 
 BufferReader (const BufferReader &)=delete
 
BufferReaderoperator= (BufferReader &&)=delete
 
BufferReaderoperator= (const BufferReader &)=delete
 
uint64_t read (std::byte **output, uint64_t offset, uint64_t size) override
 This method is called by MCAP reader classes when they need to read a portion of the file. More...
 
void reset (const std::byte *data, uint64_t size, uint64_t uncompressedSize) override
 Reset the reader state, clearing any internal buffers and state, and initialize with new compressed data. More...
 
uint64_t size () const override
 Returns the size of the file in bytes. More...
 
Status status () const override
 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. More...
 
- Public Member Functions inherited from mcap::ICompressedReader
virtual ~ICompressedReader () override=default
 
- Public Member Functions inherited from mcap::IReadable
virtual ~IReadable ()=default
 

Private Attributes

const std::byte * data_
 
uint64_t size_
 

Detailed Description

A "null" compressed reader that directly passes through uncompressed data. No internal buffers are allocated.

Definition at line 135 of file reader.hpp.

Constructor & Destructor Documentation

◆ BufferReader() [1/3]

mcap::BufferReader::BufferReader ( )
default

◆ BufferReader() [2/3]

mcap::BufferReader::BufferReader ( const BufferReader )
delete

◆ BufferReader() [3/3]

mcap::BufferReader::BufferReader ( BufferReader &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

BufferReader& mcap::BufferReader::operator= ( BufferReader &&  )
delete

◆ operator=() [2/2]

BufferReader& mcap::BufferReader::operator= ( const BufferReader )
delete

◆ read()

uint64_t mcap::BufferReader::read ( std::byte **  output,
uint64_t  offset,
uint64_t  size 
)
overridevirtual

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.

Implements mcap::IReadable.

◆ reset()

void mcap::BufferReader::reset ( const std::byte *  data,
uint64_t  size,
uint64_t  uncompressedSize 
)
overridevirtual

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.

Implements mcap::ICompressedReader.

◆ size()

uint64_t mcap::BufferReader::size ( ) const
overridevirtual

Returns the size of the file in bytes.

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

Implements mcap::IReadable.

◆ status()

Status mcap::BufferReader::status ( ) const
overridevirtual

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.

Implements mcap::ICompressedReader.

Member Data Documentation

◆ data_

const std::byte* mcap::BufferReader::data_
private

Definition at line 149 of file reader.hpp.

◆ size_

uint64_t mcap::BufferReader::size_
private

Definition at line 150 of file reader.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:31