pjmsg_mcap_wrapper
|
A "null" compressed reader that directly passes through uncompressed data. No internal buffers are allocated.
Definition at line 135 of file reader.hpp.
#include <reader.hpp>
Public Member Functions | |
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. | |
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. | |
uint64_t | size () const override |
Returns the size of the file in bytes. | |
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. | |
BufferReader ()=default | |
BufferReader (const BufferReader &)=delete | |
BufferReader & | operator= (const BufferReader &)=delete |
BufferReader (BufferReader &&)=delete | |
BufferReader & | operator= (BufferReader &&)=delete |
Private Attributes | |
const std::byte * | data_ |
uint64_t | size_ |
|
default |
|
delete |
|
delete |
|
delete |
|
delete |
|
overridevirtual |
This method is called by MCAP reader classes when they need to read a portion of the file.
output | A 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(). |
offset | The offset in bytes from the beginning of the file to read. |
size | The number of bytes to read. |
output
to output + size
. If the read fails, this method should return 0. Implements mcap::IReadable.
Definition at line 27 of file reader.inl.
|
overridevirtual |
Reset the reader state, clearing any internal buffers and state, and initialize with new compressed data.
data | Compressed data to read from. |
size | Size of the compressed data in bytes. |
uncompressedSize | Size of the data in bytes after decompression. A buffer of this size will be allocated for the uncompressed data. |
Implements mcap::ICompressedReader.
Definition at line 20 of file reader.inl.
|
overridevirtual |
Returns the size of the file in bytes.
Implements mcap::IReadable.
Definition at line 37 of file reader.inl.
|
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.
Definition at line 41 of file reader.inl.
|
private |
Definition at line 149 of file reader.hpp.
|
private |
Definition at line 150 of file reader.hpp.