ADTF File Library
Loading...
Searching...
No Matches
time_extension_reader.h
Go to the documentation of this file.
1
16
17#pragma once
18#include <adtf_file/reader.h>
19
20namespace adtfdat_processing
21{
22
28{
29public:
34
35 std::string getReaderIdentifier() const override;
36 void open(const std::string& file_name,
37 std::shared_ptr<adtf_file::SampleFactory> sample_factory,
38 std::shared_ptr<adtf_file::StreamTypeFactory> stream_type_factory) override;
39
40 uint32_t getFileVersion() const override;
41 std::string getDescription() const override;
42 std::vector<adtf_file::Stream> getStreams() const override;
43 std::vector<adtf_file::Extension> getExtensions() const override;
45 std::optional<uint64_t> getItemCount() const override;
46 std::optional<double> getProgress() const override;
47
48 uint64_t getItemIndexForTimeStamp(std::chrono::nanoseconds time_stamp) override;
49 uint64_t getItemIndexForStreamItemIndex(uint16_t stream_id, uint64_t stream_item_index) override;
50 std::shared_ptr<const adtf_file::StreamType> getStreamTypeBefore(uint64_t item_index, uint16_t stream_id) override;
51 void seekTo(uint64_t item_index) override;
52
53private:
54 std::shared_ptr<adtf_file::SampleFactory> _sample_factory;
55 std::shared_ptr<adtf_file::StreamTypeFactory> _stream_type_factory;
56 std::shared_ptr<Reader> _reader;
57 std::vector<adtf_file::Stream> _streams;
58 uint16_t _time_extension_stream_id;
59 std::chrono::nanoseconds _time_extension;
60 std::chrono::nanoseconds _remaining_time_extension;
61 std::chrono::nanoseconds _time_extension_interval;
62 std::chrono::nanoseconds _time_extension_last;
63 bool _next_item_is_sample = true;
64};
65
70
71}
Definition reader.h:345
class to create or read a file item. This file item is either a sample, streamtype or trigger.
Definition reader.h:172
Default Reader factory implementation for readers using a standard default CTOR.
Definition reader.h:367
Interface for seekable Reader, where the file position can be adapted.
Definition reader.h:288
std::string getDescription() const override
uint32_t getFileVersion() const override
void seekTo(uint64_t item_index) override
std::string getReaderIdentifier() const override
Get the Reader Identifier of the Reader.
std::shared_ptr< const adtf_file::StreamType > getStreamTypeBefore(uint64_t item_index, uint16_t stream_id) override
adtf_file::FileItem getNextItem() override
uint64_t getItemIndexForTimeStamp(std::chrono::nanoseconds time_stamp) override
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...
uint64_t getItemIndexForStreamItemIndex(uint16_t stream_id, uint64_t stream_item_index) override
std::vector< adtf_file::Extension > getExtensions() const override
Get the Extensions if any.
std::vector< adtf_file::Stream > getStreams() const override
Get the Streams.
std::optional< uint64_t > getItemCount() const override
Get the Item Count. This gets the overall count of all items (samples, stream types and triggers) of ...
std::optional< double > getProgress() const override
Get the Progress, a relative file position between 0.0 and 1.0.
namespace for ADTF DAT Processing library.
Definition ddl_helpers.h:38
adtf_file::ReaderFactoryImplementation< TimeExtensionReader > TimeExtensionReaderFactory
Default reader factory implementation for the TimeExtensionReader.
Definition time_extension_reader.h:69