reader.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "intervaltree.hpp"
4 #include "read_job_queue.hpp"
5 #include "types.hpp"
6 #include "visibility.hpp"
7 #include <cstdio>
8 #include <fstream>
9 #include <map>
10 #include <memory>
11 #include <optional>
12 #include <string>
13 #include <unordered_map>
14 #include <unordered_set>
15 #include <vector>
16 
17 namespace mcap {
18 
19 enum struct ReadSummaryMethod {
37  ForceScan,
38 };
39 
44  virtual ~IReadable() = default;
45 
51  virtual uint64_t size() const = 0;
68  virtual uint64_t read(std::byte** output, uint64_t offset, uint64_t size) = 0;
69 };
70 
75 class MCAP_PUBLIC FileReader final : public IReadable {
76 public:
77  FileReader(std::FILE* file);
78 
79  uint64_t size() const override;
80  uint64_t read(std::byte** output, uint64_t offset, uint64_t size) override;
81 
82 private:
83  std::FILE* file_;
84  std::vector<std::byte> buffer_;
85  uint64_t size_;
86  uint64_t position_;
87 };
88 
92 class MCAP_PUBLIC FileStreamReader final : public IReadable {
93 public:
94  FileStreamReader(std::ifstream& stream);
95 
96  uint64_t size() const override;
97  uint64_t read(std::byte** output, uint64_t offset, uint64_t size) override;
98 
99 private:
100  std::ifstream& stream_;
101  std::vector<std::byte> buffer_;
102  uint64_t size_;
103  uint64_t position_;
104 };
105 
110 public:
111  virtual ~ICompressedReader() override = default;
112 
122  virtual void reset(const std::byte* data, uint64_t size, uint64_t uncompressedSize) = 0;
128  virtual Status status() const = 0;
129 };
130 
136 public:
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;
141 
142  BufferReader() = default;
143  BufferReader(const BufferReader&) = delete;
144  BufferReader& operator=(const BufferReader&) = delete;
145  BufferReader(BufferReader&&) = delete;
146  BufferReader& operator=(BufferReader&&) = delete;
147 
148 private:
149  const std::byte* data_;
150  uint64_t size_;
151 };
152 
158 public:
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;
163 
174  static Status DecompressAll(const std::byte* data, uint64_t compressedSize,
175  uint64_t uncompressedSize, ByteArray* output);
176  ZStdReader() = default;
177  ZStdReader(const ZStdReader&) = delete;
178  ZStdReader& operator=(const ZStdReader&) = delete;
179  ZStdReader(ZStdReader&&) = delete;
180  ZStdReader& operator=(ZStdReader&&) = delete;
181 
182 private:
185 };
186 
192 public:
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;
197 
208  Status decompressAll(const std::byte* data, uint64_t size, uint64_t uncompressedSize,
209  ByteArray* output);
210  LZ4Reader();
211  LZ4Reader(const LZ4Reader&) = delete;
212  LZ4Reader& operator=(const LZ4Reader&) = delete;
213  LZ4Reader(LZ4Reader&&) = delete;
214  LZ4Reader& operator=(LZ4Reader&&) = delete;
215  ~LZ4Reader() override;
216 
217 private:
218  void* decompressionContext_ = nullptr; // LZ4F_dctx*
220  const std::byte* compressedData_;
222  uint64_t compressedSize_;
224 };
225 
226 struct LinearMessageView;
227 
232 public:
236  Timestamp startTime = 0;
240  Timestamp endTime = MaxTime;
246  std::function<bool(std::string_view)> topicFilter;
247  enum struct ReadOrder { FileOrder, LogTimeOrder, ReverseLogTimeOrder };
254  ReadOrder readOrder = ReadOrder::FileOrder;
255 
257  : startTime(start)
258  , endTime(end) {}
259 
260  ReadMessageOptions() = default;
261 
265  Status validate() const;
266 };
267 
271 class MCAP_PUBLIC McapReader final {
272 public:
273  ~McapReader();
274 
285  Status open(IReadable& reader);
294  Status open(std::string_view filename);
304  Status open(std::ifstream& stream);
305 
311  void close();
312 
320  Status readSummary(
321  ReadSummaryMethod method, const ProblemCallback& onProblem = [](const Status&) {});
322 
334  LinearMessageView readMessages(Timestamp startTime = 0, Timestamp endTime = MaxTime);
349  LinearMessageView readMessages(const ProblemCallback& onProblem, Timestamp startTime = 0,
350  Timestamp endTime = MaxTime);
351 
357  LinearMessageView readMessages(const ProblemCallback& onProblem,
358  const ReadMessageOptions& options);
359 
375  std::pair<ByteOffset, ByteOffset> byteRange(Timestamp startTime,
376  Timestamp endTime = MaxTime) const;
377 
382  IReadable* dataSource();
383 
387  const std::optional<Header>& header() const;
391  const std::optional<Footer>& footer() const;
395  const std::optional<Statistics>& statistics() const;
396 
401  const std::unordered_map<ChannelId, ChannelPtr> channels() const;
406  const std::unordered_map<SchemaId, SchemaPtr> schemas() const;
407 
415  ChannelPtr channel(ChannelId channelId) const;
423  SchemaPtr schema(SchemaId schemaId) const;
424 
429  const std::vector<ChunkIndex>& chunkIndexes() const;
430 
436  const std::multimap<std::string, MetadataIndex>& metadataIndexes() const;
437 
438  // The following static methods are used internally for parsing MCAP records
439  // and do not need to be called directly unless you are implementing your own
440  // reader functionality or tests.
441 
442  static Status ReadRecord(IReadable& reader, uint64_t offset, Record* record);
443  static Status ReadFooter(IReadable& reader, uint64_t offset, Footer* footer);
444 
445  static Status ParseHeader(const Record& record, Header* header);
446  static Status ParseFooter(const Record& record, Footer* footer);
447  static Status ParseSchema(const Record& record, Schema* schema);
448  static Status ParseChannel(const Record& record, Channel* channel);
449  static Status ParseMessage(const Record& record, Message* message);
450  static Status ParseChunk(const Record& record, Chunk* chunk);
451  static Status ParseMessageIndex(const Record& record, MessageIndex* messageIndex);
452  static Status ParseChunkIndex(const Record& record, ChunkIndex* chunkIndex);
453  static Status ParseAttachment(const Record& record, Attachment* attachment);
454  static Status ParseAttachmentIndex(const Record& record, AttachmentIndex* attachmentIndex);
455  static Status ParseStatistics(const Record& record, Statistics* statistics);
456  static Status ParseMetadata(const Record& record, Metadata* metadata);
457  static Status ParseMetadataIndex(const Record& record, MetadataIndex* metadataIndex);
458  static Status ParseSummaryOffset(const Record& record, SummaryOffset* summaryOffset);
459  static Status ParseDataEnd(const Record& record, DataEnd* dataEnd);
460 
464  static std::optional<Compression> ParseCompression(const std::string_view compression);
465 
466 private:
469 
470  IReadable* input_ = nullptr;
471  std::FILE* file_ = nullptr;
472  std::unique_ptr<FileReader> fileInput_;
473  std::unique_ptr<FileStreamReader> fileStreamInput_;
474  std::optional<Header> header_;
475  std::optional<Footer> footer_;
476  std::optional<Statistics> statistics_;
477  std::vector<ChunkIndex> chunkIndexes_;
479  std::multimap<std::string, AttachmentIndex> attachmentIndexes_;
480  std::multimap<std::string, MetadataIndex> metadataIndexes_;
481  std::unordered_map<SchemaId, SchemaPtr> schemas_;
482  std::unordered_map<ChannelId, ChannelPtr> channels_;
483  ByteOffset dataStart_ = 0;
484  ByteOffset dataEnd_ = EndOffset;
485  Timestamp startTime_ = 0;
486  Timestamp endTime_ = 0;
487  bool parsedSummary_ = false;
488 
489  void reset_();
490  Status readSummarySection_(IReadable& reader);
491  Status readSummaryFromScan_(IReadable& reader);
492 };
493 
501 
502  RecordReader(IReadable& dataSource, ByteOffset startOffset, ByteOffset endOffset = EndOffset);
503 
504  void reset(IReadable& dataSource, ByteOffset startOffset, ByteOffset endOffset);
505 
506  std::optional<Record> next();
507 
508  const Status& status() const;
509 
510  ByteOffset curRecordOffset() const;
511 
512 private:
513  IReadable* dataSource_ = nullptr;
516 };
517 
519  std::function<void(const SchemaPtr, ByteOffset)> onSchema;
520  std::function<void(const ChannelPtr, ByteOffset)> onChannel;
521  std::function<void(const Message&, ByteOffset)> onMessage;
522  std::function<void(const Record&, ByteOffset)> onUnknownRecord;
523 
525  TypedChunkReader(const TypedChunkReader&) = delete;
526  TypedChunkReader& operator=(const TypedChunkReader&) = delete;
528  TypedChunkReader& operator=(TypedChunkReader&&) = delete;
529 
530  void reset(const Chunk& chunk, Compression compression);
531 
532  bool next();
533 
534  ByteOffset offset() const;
535 
536  const Status& status() const;
537 
538 private:
544 };
545 
551  std::function<void(const Header&, ByteOffset)> onHeader;
552  std::function<void(const Footer&, ByteOffset)> onFooter;
553  std::function<void(const SchemaPtr, ByteOffset, std::optional<ByteOffset>)> onSchema;
554  std::function<void(const ChannelPtr, ByteOffset, std::optional<ByteOffset>)> onChannel;
555  std::function<void(const Message&, ByteOffset, std::optional<ByteOffset>)> onMessage;
556  std::function<void(const Chunk&, ByteOffset)> onChunk;
557  std::function<void(const MessageIndex&, ByteOffset)> onMessageIndex;
558  std::function<void(const ChunkIndex&, ByteOffset)> onChunkIndex;
559  std::function<void(const Attachment&, ByteOffset)> onAttachment;
561  std::function<void(const Statistics&, ByteOffset)> onStatistics;
562  std::function<void(const Metadata&, ByteOffset)> onMetadata;
563  std::function<void(const MetadataIndex&, ByteOffset)> onMetadataIndex;
564  std::function<void(const SummaryOffset&, ByteOffset)> onSummaryOffset;
565  std::function<void(const DataEnd&, ByteOffset)> onDataEnd;
566  std::function<void(const Record&, ByteOffset, std::optional<ByteOffset>)> onUnknownRecord;
567  std::function<void(ByteOffset)> onChunkEnd;
568 
569  TypedRecordReader(IReadable& dataSource, ByteOffset startOffset,
570  ByteOffset endOffset = EndOffset);
571 
572  TypedRecordReader(const TypedRecordReader&) = delete;
573  TypedRecordReader& operator=(const TypedRecordReader&) = delete;
575  TypedRecordReader& operator=(TypedRecordReader&&) = delete;
576 
577  bool next();
578 
579  ByteOffset offset() const;
580 
581  const Status& status() const;
582 
583 private:
588 };
589 
599 public:
601  const std::function<void(const Message&, RecordOffset)> onMessage);
602 
610  bool next();
611 
617  Status status() const;
618 
619 private:
620  struct ChunkSlot {
623  int unreadMessages = 0;
624  };
625  size_t findFreeChunkSlot();
626  void decompressChunk(const Chunk& chunk, ChunkSlot& slot);
632  std::unordered_set<ChannelId> selectedChannels_;
633  std::function<void(const Message&, RecordOffset)> onMessage_;
635  std::vector<ChunkSlot> chunkSlots_;
636 };
637 
643  using iterator_category = std::input_iterator_tag;
644  using difference_type = int64_t;
646  using pointer = const MessageView*;
647  using reference = const MessageView&;
648 
649  reference operator*() const;
650  pointer operator->() const;
651  Iterator& operator++();
652  void operator++(int);
653  MCAP_PUBLIC friend bool operator==(const Iterator& a, const Iterator& b);
654  MCAP_PUBLIC friend bool operator!=(const Iterator& a, const Iterator& b);
655 
656  private:
658 
659  Iterator() = default;
660  Iterator(McapReader& mcapReader, ByteOffset dataStart, ByteOffset dataEnd,
661  const ReadMessageOptions& options, const ProblemCallback& onProblem);
662 
663  class Impl {
664  public:
665  Impl(McapReader& mcapReader, ByteOffset dataStart, ByteOffset dataEnd,
666  const ReadMessageOptions& options, const ProblemCallback& onProblem);
667 
668  Impl(const Impl&) = delete;
669  Impl& operator=(const Impl&) = delete;
670  Impl(Impl&&) = delete;
671  Impl& operator=(Impl&&) = delete;
672 
673  void increment();
674  reference dereference() const;
675  bool has_value() const;
676 
678  std::optional<TypedRecordReader> recordReader_;
679  std::optional<IndexedMessageReader> indexedMessageReader_;
683  std::optional<MessageView> curMessageView_;
684 
685  private:
686  void onMessage(const Message& message, RecordOffset offset);
687  };
688 
689  std::unique_ptr<Impl> impl_;
690  };
691 
692  LinearMessageView(McapReader& mcapReader, const ProblemCallback& onProblem);
693  LinearMessageView(McapReader& mcapReader, ByteOffset dataStart, ByteOffset dataEnd,
694  Timestamp startTime, Timestamp endTime, const ProblemCallback& onProblem);
695  LinearMessageView(McapReader& mcapReader, const ReadMessageOptions& options, ByteOffset dataStart,
696  ByteOffset dataEnd, const ProblemCallback& onProblem);
697 
698  LinearMessageView(const LinearMessageView&) = delete;
699  LinearMessageView& operator=(const LinearMessageView&) = delete;
701  LinearMessageView& operator=(LinearMessageView&&) = delete;
702 
703  Iterator begin();
704  Iterator end();
705 
706 private:
712 };
713 
714 } // namespace mcap
715 
716 #ifdef MCAP_IMPLEMENTATION
717 # include "reader.inl"
718 #endif
mcap::TypedRecordReader::chunkReader_
TypedChunkReader chunkReader_
Definition: reader.hpp:585
mcap::TypedRecordReader::onSchema
std::function< void(const SchemaPtr, ByteOffset, std::optional< ByteOffset >)> onSchema
Definition: reader.hpp:553
detail::operator*
FMT_CONSTEXPR auto operator*(fp x, fp y) -> fp
Definition: format.h:1701
mcap::Compression
Compression
Supported MCAP compression algorithms.
Definition: types.hpp:36
mcap::RecordReader::curRecord_
Record curRecord_
Definition: reader.hpp:515
mcap::LZ4Reader::uncompressedSize_
uint64_t uncompressedSize_
Definition: reader.hpp:223
mcap::ByteArray
std::vector< std::byte > ByteArray
Definition: types.hpp:23
mcap::IndexedMessageReader
Uses message indices to read messages out of an MCAP in log time order. The underlying MCAP must be c...
Definition: reader.hpp:598
mcap::LZ4Reader
ICompressedReader implementation that decompresses LZ4 (https://lz4.github.io/lz4/) data.
Definition: reader.hpp:191
mcap::ReadMessageOptions::topicFilter
std::function< bool(std::string_view)> topicFilter
If provided, topicFilter is called on all topics found in the MCAP file. If topicFilter returns true ...
Definition: reader.hpp:246
mcap::BufferReader
A "null" compressed reader that directly passes through uncompressed data. No internal buffers are al...
Definition: reader.hpp:135
mcap::TypedChunkReader::status_
Status status_
Definition: reader.hpp:540
mcap::LinearMessageView::Iterator::difference_type
int64_t difference_type
Definition: reader.hpp:644
mcap::TypedRecordReader::onChunkIndex
std::function< void(const ChunkIndex &, ByteOffset)> onChunkIndex
Definition: reader.hpp:558
mcap::ReadSummaryMethod::NoFallbackScan
@ NoFallbackScan
Parse the Summary section to produce seeking indexes and summary statistics. If the Summary section i...
mcap::TypedRecordReader::parsingChunk_
bool parsingChunk_
Definition: reader.hpp:587
mcap::McapReader::chunkRanges_
internal::IntervalTree< ByteOffset, ChunkIndex > chunkRanges_
Definition: reader.hpp:478
mcap::Status
Wraps a status code and string message carrying additional context.
Definition: errors.hpp:35
mcap::LZ4Reader::uncompressedData_
ByteArray uncompressedData_
Definition: reader.hpp:221
mcap::Timestamp
uint64_t Timestamp
Definition: types.hpp:20
mcap::TypedRecordReader::status_
Status status_
Definition: reader.hpp:586
types.hpp
mcap::TypedChunkReader::onMessage
std::function< void(const Message &, ByteOffset)> onMessage
Definition: reader.hpp:521
mcap::FileReader::size_
uint64_t size_
Definition: reader.hpp:85
mcap::TypedRecordReader::onChannel
std::function< void(const ChannelPtr, ByteOffset, std::optional< ByteOffset >)> onChannel
Definition: reader.hpp:554
mcap::TypedChunkReader::onChannel
std::function< void(const ChannelPtr, ByteOffset)> onChannel
Definition: reader.hpp:520
mcap::RecordReader
A low-level interface for parsing MCAP-style TLV records from a data source.
Definition: reader.hpp:498
mcap::FileStreamReader::size_
uint64_t size_
Definition: reader.hpp:102
mcap::McapReader::chunkIndexes_
std::vector< ChunkIndex > chunkIndexes_
Definition: reader.hpp:477
mcap::ChunkIndex
Chunk Index records are found in the Summary section, providing summary information for a single Chun...
Definition: types.hpp:238
mcap::MaxTime
constexpr Timestamp MaxTime
Definition: types.hpp:31
mcap::FileStreamReader::buffer_
std::vector< std::byte > buffer_
Definition: reader.hpp:101
mcap::IndexedMessageReader::queue_
internal::ReadJobQueue queue_
Definition: reader.hpp:634
mcap::RecordReader::status_
Status status_
Definition: reader.hpp:514
mcap::TypedChunkReader::onSchema
std::function< void(const SchemaPtr, ByteOffset)> onSchema
Definition: reader.hpp:519
mcap::BufferReader::data_
const std::byte * data_
Definition: reader.hpp:149
mcap::LinearMessageView::dataEnd_
ByteOffset dataEnd_
Definition: reader.hpp:709
mcap::McapReader
Provides a read interface to an MCAP file.
Definition: reader.hpp:271
mcap::IndexedMessageReader::ChunkSlot::chunkStartOffset
ByteOffset chunkStartOffset
Definition: reader.hpp:622
mcap::TypedChunkReader::lz4Reader_
LZ4Reader lz4Reader_
Definition: reader.hpp:542
mcap::LinearMessageView::Iterator::Impl::curMessage_
Message curMessage_
Definition: reader.hpp:682
mcap::Chunk
An collection of Schemas, Channels, and Messages that supports compression and indexing.
Definition: types.hpp:214
read_job_queue.hpp
mcap::FileReader::file_
std::FILE * file_
Definition: reader.hpp:83
mcap::LinearMessageView::Iterator::Impl::mcapReader_
McapReader & mcapReader_
Definition: reader.hpp:677
mcap::internal::ReadJobQueue
A priority queue of jobs for an indexed MCAP reader to execute.
Definition: read_job_queue.hpp:43
mcap::ChannelPtr
std::shared_ptr< Channel > ChannelPtr
Definition: types.hpp:176
mcap::LinearMessageView::Iterator::Impl::onProblem_
const ProblemCallback & onProblem_
Definition: reader.hpp:681
mcap::IndexedMessageReader::onMessage_
std::function< void(const Message &, RecordOffset)> onMessage_
Definition: reader.hpp:633
MCAP_PUBLIC
#define MCAP_PUBLIC
Definition: visibility.hpp:22
validate
ROSCPP_DECL bool validate(const std::string &name, std::string &error)
mcap::LinearMessageView::onProblem_
const ProblemCallback onProblem_
Definition: reader.hpp:711
mcap::LZ4Reader::compressedData_
const std::byte * compressedData_
Definition: reader.hpp:220
mcap::EndOffset
constexpr ByteOffset EndOffset
Definition: types.hpp:30
mcap::IndexedMessageReader::options_
ReadMessageOptions options_
Definition: reader.hpp:631
mcap::ReadMessageOptions::ReadMessageOptions
ReadMessageOptions(Timestamp start, Timestamp end)
Definition: reader.hpp:256
compressedSize
char int compressedSize
Definition: lz4.h:792
mcap::RecordOffset
Definition: types.hpp:353
mcap::TypedRecordReader::onHeader
std::function< void(const Header &, ByteOffset)> onHeader
Definition: reader.hpp:551
mcap::RecordReader::endOffset
ByteOffset endOffset
Definition: reader.hpp:500
mcap::ReadMessageOptions
Options for reading messages out of an MCAP file.
Definition: reader.hpp:231
mcap::Footer
The final record in an MCAP file (before the trailing magic byte sequence). Contains byte offsets fro...
Definition: types.hpp:114
nonstd::span_lite::size
span_constexpr std::size_t size(span< T, Extent > const &spn)
Definition: span.hpp:1554
mcap::ReadSummaryMethod::ForceScan
@ ForceScan
Read the file sequentially from Header to DataEnd to produce seeking indexes and summary statistics.
mcap::ReadSummaryMethod::AllowFallbackScan
@ AllowFallbackScan
If the Summary section is missing or incomplete, allow falling back to reading the file sequentially ...
mcap::internal::Interval
Definition: intervaltree.hpp:15
mcap::LZ4Reader::status_
Status status_
Definition: reader.hpp:219
mcap::LinearMessageView::readMessageOptions_
ReadMessageOptions readMessageOptions_
Definition: reader.hpp:710
mcap::TypedRecordReader::reader_
RecordReader reader_
Definition: reader.hpp:584
mcap::LinearMessageView::Iterator::Impl::readMessageOptions_
ReadMessageOptions readMessageOptions_
Definition: reader.hpp:680
mcap::TypedRecordReader::onAttachmentIndex
std::function< void(const AttachmentIndex &, ByteOffset)> onAttachmentIndex
Definition: reader.hpp:560
mcap::MessageView
Returned when iterating over Messages in a file, MessageView contains a reference to one Message,...
Definition: types.hpp:387
output
static const char * output
Definition: luac.c:38
mcap::SummaryOffset
Summary Offset records are found in the Summary Offset section. Records in the Summary section are gr...
Definition: types.hpp:339
mcap::LinearMessageView::Iterator::Impl
Definition: reader.hpp:663
mcap::McapReader::header_
std::optional< Header > header_
Definition: reader.hpp:474
mcap::Channel
Describes a Channel that messages are written to. A Channel represents a single connection from a pub...
Definition: types.hpp:158
mcap::TypedRecordReader::onChunk
std::function< void(const Chunk &, ByteOffset)> onChunk
Definition: reader.hpp:556
mcap::IReadable
An abstract interface for reading MCAP data.
Definition: reader.hpp:43
mcap::IndexedMessageReader::mcapReader_
McapReader & mcapReader_
Definition: reader.hpp:628
mcap::IndexedMessageReader::lz4Reader_
LZ4Reader lz4Reader_
Definition: reader.hpp:630
mcap::McapReader::fileInput_
std::unique_ptr< FileReader > fileInput_
Definition: reader.hpp:472
operator==
bool operator==(QwtEventPattern::MousePattern b1, QwtEventPattern::MousePattern b2)
Compare operator.
Definition: qwt_event_pattern.h:228
mcap::ByteOffset
uint64_t ByteOffset
Definition: types.hpp:21
mcap::FileStreamReader::stream_
std::ifstream & stream_
Definition: reader.hpp:100
mcap::LinearMessageView::Iterator::Impl::curMessageView_
std::optional< MessageView > curMessageView_
Definition: reader.hpp:683
mcap::Attachment
An Attachment is an arbitrary file embedded in an MCAP file, including a name, media type,...
Definition: types.hpp:255
visibility.hpp
mcap::ReadMessageOptions::ReadOrder
ReadOrder
Definition: reader.hpp:247
sol::operator!=
constexpr bool operator!=(const optional< T > &lhs, const optional< U > &rhs)
\group relop
Definition: sol.hpp:6020
nlohmann::detail::void
j template void())
Definition: json.hpp:4061
mcap::McapReader::schemas_
std::unordered_map< SchemaId, SchemaPtr > schemas_
Definition: reader.hpp:481
mcap::MetadataIndex
Metadata Index records are found in the Summary section, providing summary information for a single M...
Definition: types.hpp:324
mcap::TypedRecordReader::onDataEnd
std::function< void(const DataEnd &, ByteOffset)> onDataEnd
Definition: reader.hpp:565
mcap::IndexedMessageReader::status_
Status status_
Definition: reader.hpp:627
mcap
Definition: crc32.hpp:5
mcap::RecordReader::offset
ByteOffset offset
Definition: reader.hpp:499
mcap::TypedRecordReader
A mid-level interface for parsing and validating MCAP records from a data source.
Definition: reader.hpp:550
mcap::LZ4Reader::compressedSize_
uint64_t compressedSize_
Definition: reader.hpp:222
mcap::SchemaPtr
std::shared_ptr< Schema > SchemaPtr
Definition: types.hpp:175
mcap::TypedChunkReader::zstdReader_
ZStdReader zstdReader_
Definition: reader.hpp:543
mcap::IndexedMessageReader::ChunkSlot
Definition: reader.hpp:620
string_view
basic_string_view< char > string_view
Definition: core.h:518
mcap::FileReader
IReadable implementation wrapping a FILE* pointer created by fopen() and a read buffer.
Definition: reader.hpp:75
mcap::TypedRecordReader::onUnknownRecord
std::function< void(const Record &, ByteOffset, std::optional< ByteOffset >)> onUnknownRecord
Definition: reader.hpp:566
mcap::LinearMessageView
An iterable view of Messages in an MCAP file.
Definition: reader.hpp:641
mcap::LinearMessageView::Iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: reader.hpp:643
mcap::LinearMessageView::Iterator
Definition: reader.hpp:642
mcap::Metadata
Holds a named map of key/value strings containing arbitrary user data. Metadata records are found in ...
Definition: types.hpp:315
start
ROSCPP_DECL void start()
mcap::ReadSummaryMethod
ReadSummaryMethod
Definition: reader.hpp:19
backward::Color::reset
@ reset
Definition: backward.hpp:3678
mcap::BufferReader::size_
uint64_t size_
Definition: reader.hpp:150
reader
static const char * reader(lua_State *L, void *ud, size_t *size)
Definition: luac.c:126
mcap::Statistics
The Statistics record is found in the Summary section, providing counts and timestamp ranges for the ...
Definition: types.hpp:299
mcap::TypedChunkReader::reader_
RecordReader reader_
Definition: reader.hpp:539
mcap::IndexedMessageReader::recordReader_
RecordReader recordReader_
Definition: reader.hpp:629
mcap::LinearMessageView::Iterator::impl_
std::unique_ptr< Impl > impl_
Definition: reader.hpp:689
mcap::McapReader::metadataIndexes_
std::multimap< std::string, MetadataIndex > metadataIndexes_
Definition: reader.hpp:480
mcap::IndexedMessageReader::ChunkSlot::decompressedChunk
ByteArray decompressedChunk
Definition: reader.hpp:621
mcap::Header
Appears at the beginning of every MCAP file (after the magic byte sequence) and contains the recordin...
Definition: types.hpp:102
mcap::LinearMessageView::Iterator::LinearMessageView
friend LinearMessageView
Definition: reader.hpp:657
mcap::LinearMessageView::mcapReader_
McapReader & mcapReader_
Definition: reader.hpp:707
mcap::ZStdReader
ICompressedReader implementation that decompresses Zstandard (https://facebook.github....
Definition: reader.hpp:157
mcap::Message
A single Message published to a Channel.
Definition: types.hpp:181
mcap::IndexedMessageReader::selectedChannels_
std::unordered_set< ChannelId > selectedChannels_
Definition: reader.hpp:632
mcap::ZStdReader::uncompressedData_
ByteArray uncompressedData_
Definition: reader.hpp:184
mcap::McapReader::LinearMessageView
friend LinearMessageView
Definition: reader.hpp:468
mcap::Record
A generic Type-Length-Value record using a uint8 type and uint64 length. This is the generic form of ...
Definition: types.hpp:86
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
mcap::ProblemCallback
std::function< void(const Status &)> ProblemCallback
Definition: types.hpp:24
mcap::LinearMessageView::dataStart_
ByteOffset dataStart_
Definition: reader.hpp:708
mcap::IndexedMessageReader::chunkSlots_
std::vector< ChunkSlot > chunkSlots_
Definition: reader.hpp:635
mcap::TypedChunkReader
Definition: reader.hpp:518
mcap::TypedRecordReader::onMetadataIndex
std::function< void(const MetadataIndex &, ByteOffset)> onMetadataIndex
Definition: reader.hpp:563
mcap::FileReader::position_
uint64_t position_
Definition: reader.hpp:86
mcap::TypedRecordReader::onAttachment
std::function< void(const Attachment &, ByteOffset)> onAttachment
Definition: reader.hpp:559
mcap::McapReader::footer_
std::optional< Footer > footer_
Definition: reader.hpp:475
intervaltree.hpp
mcap::McapReader::fileStreamInput_
std::unique_ptr< FileStreamReader > fileStreamInput_
Definition: reader.hpp:473
mcap::FileReader::buffer_
std::vector< std::byte > buffer_
Definition: reader.hpp:84
mcap::MessageIndex
A list of timestamps to byte offsets for a single Channel. This record appears after each Chunk,...
Definition: types.hpp:228
mcap::TypedRecordReader::onChunkEnd
std::function< void(ByteOffset)> onChunkEnd
Definition: reader.hpp:567
mcap::DataEnd
The final record in the Data section, signaling the end of Data and beginning of Summary....
Definition: types.hpp:349
mcap::Schema
Describes a schema used for message encoding and decoding and/or describing the shape of messages....
Definition: types.hpp:131
mcap::McapReader::attachmentIndexes_
std::multimap< std::string, AttachmentIndex > attachmentIndexes_
Definition: reader.hpp:479
mcap::McapReader::channels_
std::unordered_map< ChannelId, ChannelPtr > channels_
Definition: reader.hpp:482
header
const std::string header
mcap::internal::IntervalTree
Definition: intervaltree.hpp:43
mcap::FileStreamReader::position_
uint64_t position_
Definition: reader.hpp:103
next
#define next(ls)
Definition: llex.c:32
mcap::TypedChunkReader::onUnknownRecord
std::function< void(const Record &, ByteOffset)> onUnknownRecord
Definition: reader.hpp:522
mcap::TypedRecordReader::onMetadata
std::function< void(const Metadata &, ByteOffset)> onMetadata
Definition: reader.hpp:562
mcap::LinearMessageView::Iterator::Impl::indexedMessageReader_
std::optional< IndexedMessageReader > indexedMessageReader_
Definition: reader.hpp:679
mcap::AttachmentIndex
Attachment Index records are found in the Summary section, providing summary information for a single...
Definition: types.hpp:269
mcap::TypedRecordReader::onStatistics
std::function< void(const Statistics &, ByteOffset)> onStatistics
Definition: reader.hpp:561
mcap::TypedRecordReader::onSummaryOffset
std::function< void(const SummaryOffset &, ByteOffset)> onSummaryOffset
Definition: reader.hpp:564
mcap::TypedRecordReader::onMessage
std::function< void(const Message &, ByteOffset, std::optional< ByteOffset >)> onMessage
Definition: reader.hpp:555
mcap::LinearMessageView::Iterator::Impl::recordReader_
std::optional< TypedRecordReader > recordReader_
Definition: reader.hpp:678
mcap::TypedRecordReader::onFooter
std::function< void(const Footer &, ByteOffset)> onFooter
Definition: reader.hpp:552
mcap::FileStreamReader
IReadable implementation wrapping a std::ifstream input file stream.
Definition: reader.hpp:92
mcap::McapReader::statistics_
std::optional< Statistics > statistics_
Definition: reader.hpp:476
mcap::ZStdReader::status_
Status status_
Definition: reader.hpp:183
mcap::SchemaId
uint16_t SchemaId
Definition: types.hpp:18
mcap::ICompressedReader
An abstract interface for compressed readers.
Definition: reader.hpp:109
mcap::ChannelId
uint16_t ChannelId
Definition: types.hpp:19
mcap::TypedRecordReader::onMessageIndex
std::function< void(const MessageIndex &, ByteOffset)> onMessageIndex
Definition: reader.hpp:557
mcap::TypedChunkReader::uncompressedReader_
BufferReader uncompressedReader_
Definition: reader.hpp:541


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