56 if constexpr (std::is_same_v<T, ReadMessageJob>) {
57 result = arg.timestamp;
58 }
else if constexpr (std::is_same_v<T, DecompressChunkJob>) {
60 result = arg.messageEndTime;
62 result = arg.messageStartTime;
65 static_assert(always_false_v<T>,
"non-exhaustive visitor!");
76 if constexpr (std::is_same_v<T, ReadMessageJob>) {
78 }
else if constexpr (std::is_same_v<T, DecompressChunkJob>) {
80 result.
offset = arg.messageIndexEndOffset;
82 result.
offset = arg.chunkStartOffset;
85 static_assert(always_false_v<T>,
"non-exhaustive visitor!");
95 if (aTimestamp == bTimestamp) {
98 return aTimestamp > bTimestamp;
104 if (aTimestamp == bTimestamp) {
107 return aTimestamp < bTimestamp;
114 heap_.emplace_back(std::move(decompressChunkJob));
123 heap_.emplace_back(std::move(readMessageJob));
137 auto popped =
heap_.back();
constexpr bool always_false_v
A job to decompress the chunk starting at chunkStartOffset. The message indices starting directly aft...
ByteOffset messageIndexEndOffset
Timestamp messageStartTime
ByteOffset chunkStartOffset
A priority queue of jobs for an indexed MCAP reader to execute.
static Timestamp TimeComparisonKey(const ReadJob &job, bool reverse)
return the timestamp key that should be used to compare jobs.
void push(ReadMessageJob &&readMessageJob)
void push(DecompressChunkJob &&decompressChunkJob)
static RecordOffset PositionComparisonKey(const ReadJob &job, bool reverse)
static bool CompareForward(const ReadJob &a, const ReadJob &b)
std::vector< ReadJob > heap_
ReadJobQueue(bool reverse)
static bool CompareReverse(const ReadJob &a, const ReadJob &b)
A job to read a specific message at offset offset from the decompressed chunk stored in chunkReaderIn...