23#include "ContentBlockReader.h"
24#include "DataLayout.h"
25#include "RecordFormat.h"
26#include "StreamPlayer.h"
37class DataLayoutBlockReader;
38class ImageBlockReader;
39class AudioBlockReader;
41namespace datalayout_conventions {
48 double lastReadRecordTimestamp = std::numeric_limits<double>::max();
50 vector<unique_ptr<ContentBlockReader>> contentReaders;
51 vector<unique_ptr<DataLayout>> expectedDataLayouts;
52 vector<unique_ptr<DataLayout>> legacyDataLayouts;
154 return currentReader_;
161 inline T& getExpectedLayout(
DataLayout& layout,
size_t blockIndex) {
162 return getCachedLayout<T>(currentReader_->expectedDataLayouts, layout, blockIndex);
167 inline T& getLegacyLayout(DataLayout& layout,
size_t blockIndex) {
168 return getCachedLayout<T>(currentReader_->legacyDataLayouts, layout, blockIndex);
172 vector<unique_ptr<DataLayout>>& layoutCache,
175 if (layoutCache.size() <= blockIndex) {
176 layoutCache.resize(blockIndex + 1);
178 if (!layoutCache[blockIndex]) {
179 T* expectedLayout =
new T;
180 layoutCache[blockIndex].reset(expectedLayout);
181 expectedLayout->mapLayout(layout);
183 return reinterpret_cast<T&
>(*layoutCache[blockIndex].get());
186 RecordFileReader* recordFileReader_{};
190 map<tuple<StreamId, Record::Type, uint32_t>, RecordFormatReader> readers_;
191 map<pair<StreamId, Record::Type>, RecordFormatReader*> lastReader_;
192 RecordFormatReader* currentReader_{};
Specification of a VRS record content block.
Definition RecordFormat.h:474
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:191
Container of data pointers, to tell where to write data when reading a record.
Definition DataReference.h:59
The class to read VRS files.
Definition RecordFileReader.h:66
Type
Definition Record.h:88
VRS stream identifier class.
Definition StreamId.h:242
Class designed to receive record data when reading a VRS file.
Definition StreamPlayer.h:53
Definition AsyncDiskFileChunk.hpp:49
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:27