ADTF File Library
Loading...
Searching...
No Matches
adtf_file::SeekableReader Class Referenceabstract

Interface for seekable Reader, where the file position can be adapted. More...

#include <reader.h>

Inheritance diagram for adtf_file::SeekableReader:
[legend]
Collaboration diagram for adtf_file::SeekableReader:
[legend]

Public Member Functions

virtual uint64_t getItemIndexForTimeStamp (std::chrono::nanoseconds time_stamp)=0
 
virtual uint64_t getItemIndexForStreamItemIndex (uint16_t stream_id, uint64_t stream_item_index)=0
 
virtual std::shared_ptr< const StreamTypegetStreamTypeBefore (uint64_t item_index, uint16_t stream_id)=0
 
virtual void seekTo (uint64_t item_index)=0
 
- Public Member Functions inherited from adtf_file::Reader
virtual std::string getReaderIdentifier () const =0
 Get the Reader Identifier of the Reader.
 
virtual void open (const std::string &filename, std::shared_ptr< SampleFactory > sample_factory, std::shared_ptr< StreamTypeFactory > stream_type_factory)=0
 opens a file by the given filename. The given factories must be used to create samples and streamtypes for the getNextItem call
 
virtual FileItem getNextItem ()=0
 
virtual uint32_t getFileVersion () const
 
virtual std::string getDescription () const
 
virtual std::vector< ExtensiongetExtensions () const
 Get the Extensions if any.
 
virtual std::vector< StreamgetStreams () const
 Get the Streams.
 
virtual std::optional< uint64_t > getItemCount () const
 Get the Item Count. This gets the overall count of all items (samples, stream types and triggers) of all streams.
 
virtual std::optional< double > getProgress () const
 Get the Progress, a relative file position between 0.0 and 1.0.
 
- Public Member Functions inherited from adtf_file::Configurable
virtual ~Configurable ()=default
 DTOR.
 
virtual const ConfigurationgetConfiguration () const
 
virtual void setConfiguration (const Configuration &configuration)
 

Detailed Description

Interface for seekable Reader, where the file position can be adapted.

Member Function Documentation

◆ getItemIndexForStreamItemIndex()

virtual uint64_t adtf_file::SeekableReader::getItemIndexForStreamItemIndex ( uint16_t stream_id,
uint64_t stream_item_index )
pure virtual

Find the index of the given stream item.

Parameters
[in]stream_idThe stream id.
[in]stream_item_indexThe item index within the stream.
Returns
The item index.
Remarks
The SeekableReader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
std::out_of_rangeif given item_index is out of range
std::out_of_rangeif given stream_id is out of range (must be at least 1)
std::runtime_errorif position was not found
anyother implementation dependent exceptions for the get call

Implemented in adtf_file::ADTFDatFileReader, adtfdat_processing::MultiFileReader, adtfdat_processing::SampleTimestampSanitizerReader, adtfdat_processing::SortingReader, adtfdat_processing::StreamRenamingReader, adtfdat_processing::StreamsToSubstreamsReader, and adtfdat_processing::TimeExtensionReader.

◆ getItemIndexForTimeStamp()

virtual uint64_t adtf_file::SeekableReader::getItemIndexForTimeStamp ( std::chrono::nanoseconds time_stamp)
pure virtual

Find the index of the first item that has a timestamp greator or equal to the one specified.

Parameters
[in]time_stampThe timestamp.
Returns
The item index.
Remarks
The SeekableReader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
std::runtime_errorif position was not found
anyother implementation dependent exceptions for the get call

Implemented in adtf_file::ADTFDatFileReader, adtfdat_processing::MultiFileReader, adtfdat_processing::SampleTimestampSanitizerReader, adtfdat_processing::SortingReader, adtfdat_processing::StreamRenamingReader, adtfdat_processing::StreamsToSubstreamsReader, and adtfdat_processing::TimeExtensionReader.

◆ getStreamTypeBefore()

virtual std::shared_ptr< const StreamType > adtf_file::SeekableReader::getStreamTypeBefore ( uint64_t item_index,
uint16_t stream_id )
pure virtual

Returns the stream type that is valid

Parameters
[in]item_indexThe global index before which the stream type should be retrieved.
[in]stream_idThe stream id for which the stream type should be retrieved.
Returns
A shared pointer to the stream type.
Remarks
The SeekableReader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
std::out_of_rangeif given item_index is out of range
std::out_of_rangeif given stream_id is out of range (must be at least 1)
anyother implementation dependent exceptions for the get call

Implemented in adtf_file::ADTFDatFileReader, adtfdat_processing::MultiFileReader, adtfdat_processing::SampleTimestampSanitizerReader, adtfdat_processing::SortingReader, adtfdat_processing::StreamRenamingReader, adtfdat_processing::StreamsToSubstreamsReader, and adtfdat_processing::TimeExtensionReader.

◆ seekTo()

virtual void adtf_file::SeekableReader::seekTo ( uint64_t item_index)
pure virtual

Seek to the given index, such that getNextItem() will return the item corresponding to the index on the next call.

Parameters
[in]item_indexThe index to seek to.
Remarks
The SeekableReader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
std::out_of_rangeif given item_index is out of range (check for getItemCount())
anyother implementation dependent exceptions for the seek call

Implemented in adtf_file::ADTFDatFileReader, adtfdat_processing::MultiFileReader, adtfdat_processing::SampleTimestampSanitizerReader, adtfdat_processing::SortingReader, adtfdat_processing::StreamRenamingReader, adtfdat_processing::StreamsToSubstreamsReader, and adtfdat_processing::TimeExtensionReader.


The documentation for this class was generated from the following file: