31 StreamsToSubstreamsReader();
34 void open(
const std::string& file_name,
35 std::shared_ptr<adtf_file::SampleFactory> sample_factory,
36 std::shared_ptr<adtf_file::StreamTypeFactory> stream_type_factory)
override;
40 std::vector<adtf_file::Stream>
getStreams()
const override;
48 std::shared_ptr<const adtf_file::StreamType>
getStreamTypeBefore(uint64_t item_index, uint16_t stream_id)
override;
49 void seekTo(uint64_t item_index)
override;
52 std::shared_ptr<adtf_file::SampleFactory> _sample_factory;
53 std::shared_ptr<adtf_file::StreamTypeFactory> _stream_type_factory;
54 std::shared_ptr<Reader> _reader;
60 std::shared_ptr<const adtf_file::PropertyStreamType> type;
62 bool operator==(
const SourceStream& other)
const
64 return name == other.name && type == other.type;
67 using SourceStreams = std::unordered_map<uint16_t, SourceStream>;
68 using SubstreamIDs = std::unordered_map<uint16_t, std::variant<uint32_t, std::unordered_map<uint32_t, uint32_t>>>;
72 std::shared_ptr<adtf_file::StreamType> type;
73 SubstreamIDs substream_ids;
75 MappedStreams buildMap(
const SourceStreams& streams)
const;
79 Substreams() =
default;
80 Substreams(SourceStreams source_streams,
81 MappedStreams stream_map):
82 source_streams(std::move(source_streams)),
83 stream_map(std::move(stream_map))
86 SourceStreams source_streams;
87 MappedStreams stream_map;
89 const Substreams& buildCache(uint64_t item_index);
90 std::unordered_map<uint64_t, Substreams> _seek_cache;
92 Substreams _current_substreams;
void open(const std::string &file_name, std::shared_ptr< adtf_file::SampleFactory > sample_factory, std::shared_ptr< adtf_file::StreamTypeFactory > stream_type_factory) override
opens a file by the given filename. The given factories must be used to create samples and streamtype...
adtf_file::ReaderFactoryImplementation< StreamsToSubstreamsReader > StreamsToSubstreamsReaderFactory
Default reader factory implementation for the StreamsToSubstreamsReader.
Definition streams_to_substreams_reader.h:98