Go to the documentation of this file.
13 #include <unordered_map>
14 #include <unordered_set>
51 virtual uint64_t
size()
const = 0;
68 virtual uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size) = 0;
79 uint64_t
size()
const override;
80 uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size)
override;
96 uint64_t
size()
const override;
97 uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size)
override;
122 virtual void reset(
const std::byte*
data, uint64_t
size, uint64_t uncompressedSize) = 0;
128 virtual Status status()
const = 0;
137 void reset(
const std::byte*
data, uint64_t
size, uint64_t uncompressedSize)
override;
138 uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size)
override;
139 uint64_t
size()
const override;
140 Status status()
const override;
159 void reset(
const std::byte*
data, uint64_t
size, uint64_t uncompressedSize)
override;
160 uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size)
override;
161 uint64_t
size()
const override;
162 Status status()
const override;
193 void reset(
const std::byte*
data, uint64_t
size, uint64_t uncompressedSize)
override;
194 uint64_t read(std::byte**
output, uint64_t offset, uint64_t
size)
override;
195 uint64_t
size()
const override;
196 Status status()
const override;
208 Status decompressAll(
const std::byte*
data, uint64_t
size, uint64_t uncompressedSize,
218 void* decompressionContext_ =
nullptr;
247 enum struct ReadOrder { FileOrder, LogTimeOrder, ReverseLogTimeOrder };
304 Status open(std::ifstream& stream);
375 std::pair<ByteOffset, ByteOffset> byteRange(
Timestamp startTime,
387 const std::optional<Header>&
header()
const;
391 const std::optional<Footer>& footer()
const;
395 const std::optional<Statistics>& statistics()
const;
401 const std::unordered_map<ChannelId, ChannelPtr> channels()
const;
406 const std::unordered_map<SchemaId, SchemaPtr> schemas()
const;
429 const std::vector<ChunkIndex>& chunkIndexes()
const;
436 const std::multimap<std::string, MetadataIndex>& metadataIndexes()
const;
464 static std::optional<Compression> ParseCompression(
const std::string_view compression);
471 std::FILE* file_ =
nullptr;
487 bool parsedSummary_ =
false;
506 std::optional<Record>
next();
508 const Status& status()
const;
536 const Status& status()
const;
581 const Status& status()
const;
623 int unreadMessages = 0;
625 size_t findFreeChunkSlot();
652 void operator++(
int);
669 Impl& operator=(
const Impl&) =
delete;
675 bool has_value()
const;
716 #ifdef MCAP_IMPLEMENTATION
717 # include "reader.inl"
TypedChunkReader chunkReader_
std::function< void(const SchemaPtr, ByteOffset, std::optional< ByteOffset >)> onSchema
FMT_CONSTEXPR auto operator*(fp x, fp y) -> fp
Compression
Supported MCAP compression algorithms.
uint64_t uncompressedSize_
std::vector< std::byte > ByteArray
Uses message indices to read messages out of an MCAP in log time order. The underlying MCAP must be c...
ICompressedReader implementation that decompresses LZ4 (https://lz4.github.io/lz4/) data.
std::function< bool(std::string_view)> topicFilter
If provided, topicFilter is called on all topics found in the MCAP file. If topicFilter returns true ...
A "null" compressed reader that directly passes through uncompressed data. No internal buffers are al...
std::function< void(const ChunkIndex &, ByteOffset)> onChunkIndex
@ NoFallbackScan
Parse the Summary section to produce seeking indexes and summary statistics. If the Summary section i...
internal::IntervalTree< ByteOffset, ChunkIndex > chunkRanges_
Wraps a status code and string message carrying additional context.
ByteArray uncompressedData_
std::function< void(const Message &, ByteOffset)> onMessage
std::function< void(const ChannelPtr, ByteOffset, std::optional< ByteOffset >)> onChannel
std::function< void(const ChannelPtr, ByteOffset)> onChannel
A low-level interface for parsing MCAP-style TLV records from a data source.
std::vector< ChunkIndex > chunkIndexes_
Chunk Index records are found in the Summary section, providing summary information for a single Chun...
constexpr Timestamp MaxTime
std::vector< std::byte > buffer_
internal::ReadJobQueue queue_
std::function< void(const SchemaPtr, ByteOffset)> onSchema
Provides a read interface to an MCAP file.
ByteOffset chunkStartOffset
An collection of Schemas, Channels, and Messages that supports compression and indexing.
A priority queue of jobs for an indexed MCAP reader to execute.
std::shared_ptr< Channel > ChannelPtr
const ProblemCallback & onProblem_
std::function< void(const Message &, RecordOffset)> onMessage_
ROSCPP_DECL bool validate(const std::string &name, std::string &error)
const ProblemCallback onProblem_
const std::byte * compressedData_
constexpr ByteOffset EndOffset
ReadMessageOptions options_
ReadMessageOptions(Timestamp start, Timestamp end)
std::function< void(const Header &, ByteOffset)> onHeader
Options for reading messages out of an MCAP file.
span_constexpr std::size_t size(span< T, Extent > const &spn)
@ ForceScan
Read the file sequentially from Header to DataEnd to produce seeking indexes and summary statistics.
@ AllowFallbackScan
If the Summary section is missing or incomplete, allow falling back to reading the file sequentially ...
ReadMessageOptions readMessageOptions_
ReadMessageOptions readMessageOptions_
std::function< void(const AttachmentIndex &, ByteOffset)> onAttachmentIndex
Returned when iterating over Messages in a file, MessageView contains a reference to one Message,...
static const char * output
Summary Offset records are found in the Summary Offset section. Records in the Summary section are gr...
std::optional< Header > header_
Describes a Channel that messages are written to. A Channel represents a single connection from a pub...
std::function< void(const Chunk &, ByteOffset)> onChunk
An abstract interface for reading MCAP data.
std::unique_ptr< FileReader > fileInput_
bool operator==(QwtEventPattern::MousePattern b1, QwtEventPattern::MousePattern b2)
Compare operator.
std::optional< MessageView > curMessageView_
An Attachment is an arbitrary file embedded in an MCAP file, including a name, media type,...
constexpr bool operator!=(const optional< T > &lhs, const optional< U > &rhs)
\group relop
std::unordered_map< SchemaId, SchemaPtr > schemas_
std::function< void(const DataEnd &, ByteOffset)> onDataEnd
A mid-level interface for parsing and validating MCAP records from a data source.
std::shared_ptr< Schema > SchemaPtr
basic_string_view< char > string_view
IReadable implementation wrapping a FILE* pointer created by fopen() and a read buffer.
std::function< void(const Record &, ByteOffset, std::optional< ByteOffset >)> onUnknownRecord
An iterable view of Messages in an MCAP file.
std::input_iterator_tag iterator_category
static const char * reader(lua_State *L, void *ud, size_t *size)
The Statistics record is found in the Summary section, providing counts and timestamp ranges for the ...
RecordReader recordReader_
std::unique_ptr< Impl > impl_
std::multimap< std::string, MetadataIndex > metadataIndexes_
ByteArray decompressedChunk
ICompressedReader implementation that decompresses Zstandard (https://facebook.github....
A single Message published to a Channel.
std::unordered_set< ChannelId > selectedChannels_
ByteArray uncompressedData_
A generic Type-Length-Value record using a uint8 type and uint64 length. This is the generic form of ...
std::function< void(const Status &)> ProblemCallback
std::vector< ChunkSlot > chunkSlots_
std::function< void(const MetadataIndex &, ByteOffset)> onMetadataIndex
std::function< void(const Attachment &, ByteOffset)> onAttachment
std::optional< Footer > footer_
std::unique_ptr< FileStreamReader > fileStreamInput_
std::vector< std::byte > buffer_
A list of timestamps to byte offsets for a single Channel. This record appears after each Chunk,...
std::function< void(ByteOffset)> onChunkEnd
The final record in the Data section, signaling the end of Data and beginning of Summary....
Describes a schema used for message encoding and decoding and/or describing the shape of messages....
std::multimap< std::string, AttachmentIndex > attachmentIndexes_
std::unordered_map< ChannelId, ChannelPtr > channels_
std::function< void(const Record &, ByteOffset)> onUnknownRecord
std::function< void(const Metadata &, ByteOffset)> onMetadata
std::optional< IndexedMessageReader > indexedMessageReader_
Attachment Index records are found in the Summary section, providing summary information for a single...
std::function< void(const Statistics &, ByteOffset)> onStatistics
std::function< void(const SummaryOffset &, ByteOffset)> onSummaryOffset
std::function< void(const Message &, ByteOffset, std::optional< ByteOffset >)> onMessage
std::optional< TypedRecordReader > recordReader_
std::function< void(const Footer &, ByteOffset)> onFooter
IReadable implementation wrapping a std::ifstream input file stream.
std::optional< Statistics > statistics_
An abstract interface for compressed readers.
std::function< void(const MessageIndex &, ByteOffset)> onMessageIndex
BufferReader uncompressedReader_
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46