adtf_file_library  0.13.1
Public Member Functions | List of all members
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. More...
 
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 More...
 
virtual FileItem getNextItem ()=0
 
virtual uint32_t getFileVersion () const
 
virtual std::string getDescription () const
 
virtual std::vector< ExtensiongetExtensions () const
 Get the Extensions if any. More...
 
virtual std::vector< StreamgetStreams () const
 Get the Streams. More...
 
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. More...
 
virtual std::optional< double > getProgress () const
 Get the Progress, a relative file position between 0.0 and 1.0. More...
 
- 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.

◆ 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.

◆ 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.

◆ 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 Reader::getItemCount)
anyother implementation dependent exceptions for the seek call

Implemented in adtf_file::ADTFDatFileReader.


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

Copyright © CARIAD SE.
Generated on Fri Apr 19 2024 by doxygen 1.9.1
GIT Commit Hash: 82d535f82776c20b12fc60740bdae991b62444a7