pjmsg_mcap_wrapper
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mcap::IndexedMessageReader Struct Reference

Detailed Description

Uses message indices to read messages out of an MCAP in log time order. The underlying MCAP must be chunked, with a summary section and message indexes. The required McapWriterOptions are:

Definition at line 611 of file reader.hpp.

#include <reader.hpp>

Classes

struct  ChunkSlot
 

Public Member Functions

 IndexedMessageReader (McapReader &reader, const ReadMessageOptions &options, const std::function< void(const Message &, RecordOffset)> onMessage)
 
bool next ()
 reads the next message out of the MCAP.
 
Status status () const
 gets the status of the reader.
 

Private Member Functions

size_t findFreeChunkSlot ()
 
void decompressChunk (const Chunk &chunk, ChunkSlot &slot)
 

Private Attributes

Status status_
 
McapReadermcapReader_
 
RecordReader recordReader_
 
LZ4Reader lz4Reader_
 
ReadMessageOptions options_
 
std::unordered_set< ChannelIdselectedChannels_
 
std::function< void(const Message &, RecordOffset)> onMessage_
 
internal::ReadJobQueue queue_
 
std::vector< ChunkSlotchunkSlots_
 

Constructor & Destructor Documentation

◆ IndexedMessageReader()

mcap::IndexedMessageReader::IndexedMessageReader ( McapReader reader,
const ReadMessageOptions options,
const std::function< void(const Message &, RecordOffset)>  onMessage 
)

Definition at line 1800 of file reader.inl.

Member Function Documentation

◆ decompressChunk()

void mcap::IndexedMessageReader::decompressChunk ( const Chunk chunk,
IndexedMessageReader::ChunkSlot slot 
)
private

Definition at line 1864 of file reader.inl.

◆ findFreeChunkSlot()

size_t mcap::IndexedMessageReader::findFreeChunkSlot ( )
private

Definition at line 1854 of file reader.inl.

◆ next()

bool mcap::IndexedMessageReader::next ( )

reads the next message out of the MCAP.

Returns
true if a message was found.
false if no more messages are to be read. If there was some error reading the MCAP, status() will return a non-Success status.

Definition at line 1895 of file reader.inl.

◆ status()

Status mcap::IndexedMessageReader::status ( ) const

gets the status of the reader.

Returns
Status

Definition at line 1985 of file reader.inl.

Member Data Documentation

◆ chunkSlots_

std::vector<ChunkSlot> mcap::IndexedMessageReader::chunkSlots_
private

Definition at line 650 of file reader.hpp.

◆ lz4Reader_

LZ4Reader mcap::IndexedMessageReader::lz4Reader_
private

Definition at line 644 of file reader.hpp.

◆ mcapReader_

McapReader& mcap::IndexedMessageReader::mcapReader_
private

Definition at line 641 of file reader.hpp.

◆ onMessage_

std::function<void(const Message&, RecordOffset)> mcap::IndexedMessageReader::onMessage_
private

Definition at line 648 of file reader.hpp.

◆ options_

ReadMessageOptions mcap::IndexedMessageReader::options_
private

Definition at line 646 of file reader.hpp.

◆ queue_

internal::ReadJobQueue mcap::IndexedMessageReader::queue_
private

Definition at line 649 of file reader.hpp.

◆ recordReader_

RecordReader mcap::IndexedMessageReader::recordReader_
private

Definition at line 642 of file reader.hpp.

◆ selectedChannels_

std::unordered_set<ChannelId> mcap::IndexedMessageReader::selectedChannels_
private

Definition at line 647 of file reader.hpp.

◆ status_

Status mcap::IndexedMessageReader::status_
private

Definition at line 640 of file reader.hpp.


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