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;
155 return currentReader_;
162 inline T& getExpectedLayout(
DataLayout& layout,
size_t blockIndex) {
163 return getCachedLayout<T>(currentReader_->expectedDataLayouts, layout, blockIndex);
168 inline T& getLegacyLayout(DataLayout& layout,
size_t blockIndex) {
169 return getCachedLayout<T>(currentReader_->legacyDataLayouts, layout, blockIndex);
173 vector<unique_ptr<DataLayout>>& layoutCache,
176 if (layoutCache.size() <= blockIndex) {
177 layoutCache.resize(blockIndex + 1);
179 if (!layoutCache[blockIndex]) {
180 T* expectedLayout =
new T;
181 layoutCache[blockIndex].reset(expectedLayout);
182 expectedLayout->mapLayout(layout);
184 return reinterpret_cast<T&
>(*layoutCache[blockIndex].get());
187 RecordFileReader* recordFileReader_{};
191 map<tuple<StreamId, Record::Type, uint32_t>, RecordFormatReader> readers_;
192 map<pair<StreamId, Record::Type>, RecordFormatReader*> lastReader_;
193 RecordFormatReader* currentReader_{};
Specification of a VRS record content block.
Definition RecordFormat.h:508
The DataLayout class describes the data stored inside a DataLayoutContentBlock.
Definition DataLayout.h:209
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:245
Class designed to receive record data when reading a VRS file.
Definition StreamPlayer.h:53
Definition Compressor.cpp:113
Class describing which record is being read. Most fields are really self explanatory.
Definition StreamPlayer.h:27