Struct ReadMessageOptions

Struct Documentation

struct ReadMessageOptions

Options for reading messages out of an MCAP file.

Public Types

enum class ReadOrder

Values:

enumerator FileOrder
enumerator LogTimeOrder
enumerator ReverseLogTimeOrder

Public Functions

inline ReadMessageOptions(Timestamp start, Timestamp end)
ReadMessageOptions() = default
Status validate() const

validate the configuration.

Public Members

Timestamp startTime = 0

Only messages with log timestamps greater or equal to startTime will be included.

Timestamp endTime = MaxTime

Only messages with log timestamps less than endTime will be included.

std::function<bool(std::string_view)> topicFilter

If provided, topicFilter is called on all topics found in the MCAP file. If topicFilter returns true for a given channel, messages from that channel will be included. if not provided, messages from all channels are provided.

ReadOrder readOrder = ReadOrder::FileOrder

Set the expected order that messages should be returned in. if readOrder == FileOrder, messages will be returned in the order they appear in the MCAP file. if readOrder == LogTimeOrder, messages will be returned in ascending log time order. if readOrder == ReverseLogTimeOrder, messages will be returned in descending log time order.