ADTF File Library
Loading...
Searching...
No Matches
adtfdat_processing::SortingProxyReader Class Reference

Proxy Reader that allows you to sort items from delegate readers. More...

#include <sorting_reader.h>

Inheritance diagram for adtfdat_processing::SortingProxyReader:
[legend]
Collaboration diagram for adtfdat_processing::SortingProxyReader:
[legend]

Public Member Functions

 SortingProxyReader ()
 CTOR.
 
std::string getReaderIdentifier () const override
 Get the Reader Identifier of the Reader.
 
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 streamtypes for the getNextItem call
 
uint32_t getFileVersion () const override
 
std::string getDescription () const override
 
std::vector< adtf_file::StreamgetStreams () const override
 Get the Streams.
 
std::vector< adtf_file::ExtensiongetExtensions () const override
 Get the Extensions if any.
 
adtf_file::FileItem getNextUnsortedItem () override
 
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 all streams.
 
std::optional< double > getProgress () const override
 Get the Progress, a relative file position between 0.0 and 1.0.
 
uint64_t getUnsortedItemIndexForTimeStamp (std::chrono::nanoseconds time_stamp) override
 
std::shared_ptr< const adtf_file::StreamTypegetUnsortedStreamTypeBefore (uint64_t item_index, uint16_t stream_id) override
 
void unsortedSeekTo (uint64_t item_index) override
 
- Public Member Functions inherited from adtfdat_processing::SortingReader
void open (const std::vector< adtf_file::Stream > &streams, bool sample_timestamps, std::chrono::seconds sorting_window, bool trigger_for_each_sample)
 prepare the sorting algorithm.
 
adtf_file::FileItem getNextItem () final override
 
uint64_t getItemIndexForTimeStamp (std::chrono::nanoseconds time_stamp) override
 
uint64_t getItemIndexForStreamItemIndex (uint16_t stream_id, uint64_t stream_item_index) override
 
std::shared_ptr< const adtf_file::StreamTypegetStreamTypeBefore (uint64_t item_index, uint16_t stream_id) override
 
void seekTo (uint64_t item_index) override
 
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
 
- Public Member Functions inherited from adtf_file::Configurable
virtual ~Configurable ()=default
 DTOR.
 
virtual const ConfigurationgetConfiguration () const
 
virtual void setConfiguration (const Configuration &configuration)
 

Detailed Description

Proxy Reader that allows you to sort items from delegate readers.

Member Function Documentation

◆ getDescription()

std::string adtfdat_processing::SortingProxyReader::getDescription ( ) const
overridevirtual
Returns
A descriptive text for the opened file.

Reimplemented from adtf_file::Reader.

◆ getExtensions()

std::vector< adtf_file::Extension > adtfdat_processing::SortingProxyReader::getExtensions ( ) const
overridevirtual

Get the Extensions if any.

Returns
std::vector<Extension> A vector of all available extensions.

Reimplemented from adtf_file::Reader.

◆ getFileVersion()

uint32_t adtfdat_processing::SortingProxyReader::getFileVersion ( ) const
overridevirtual

The file version with respect to ADTF DAT Format. When implementing a reader yourself

  • use ifhd::v201_v301::version_id if you do not explicitly create trigger items.
  • use ifhd::v500::version_id otherwise.
    Returns
    the file format version.

Reimplemented from adtf_file::Reader.

◆ getItemCount()

std::optional< uint64_t > adtfdat_processing::SortingProxyReader::getItemCount ( ) const
overridevirtual

Get the Item Count. This gets the overall count of all items (samples, stream types and triggers) of all streams.

Remarks
if it is not possible to retrieve the item count, return std::nullopt instead.
Returns
std::optional<uint64_t>

Reimplemented from adtf_file::Reader.

◆ getNextUnsortedItem()

adtf_file::FileItem adtfdat_processing::SortingProxyReader::getNextUnsortedItem ( )
overridevirtual

Returns the next item of the file and increase the item index to the next one. These can be samples, streamtypes or trigger.

Returns
The next item.
Exceptions
exceptions::EndOfFileif end of file was reached
std::exceptionbased exception for any other implementation dependent case to identify error on getNextUnsortedItem call

Implements adtfdat_processing::SortingReader.

◆ getProgress()

std::optional< double > adtfdat_processing::SortingProxyReader::getProgress ( ) const
overridevirtual

Get the Progress, a relative file position between 0.0 and 1.0.

Returns
std::optional<double> The relative value between 0.0 and 1.0 where internal file position is.

Reimplemented from adtf_file::Reader.

◆ getReaderIdentifier()

std::string adtfdat_processing::SortingProxyReader::getReaderIdentifier ( ) const
overridevirtual

Get the Reader Identifier of the Reader.

Returns
the reader identifier

Implements adtf_file::Reader.

◆ getStreams()

std::vector< adtf_file::Stream > adtfdat_processing::SortingProxyReader::getStreams ( ) const
overridevirtual

Get the Streams.

Returns
std::vector<Stream> A vector of all available streams.

Reimplemented from adtf_file::Reader.

◆ getUnsortedItemIndexForTimeStamp()

uint64_t adtfdat_processing::SortingProxyReader::getUnsortedItemIndexForTimeStamp ( std::chrono::nanoseconds time_stamp)
overridevirtual

Reimplemented from adtfdat_processing::SortingReader.

◆ getUnsortedStreamTypeBefore()

std::shared_ptr< const adtf_file::StreamType > adtfdat_processing::SortingProxyReader::getUnsortedStreamTypeBefore ( uint64_t item_index,
uint16_t stream_id )
overridevirtual

Reimplemented from adtfdat_processing::SortingReader.

◆ open()

void adtfdat_processing::SortingProxyReader::open ( const std::string & filename,
std::shared_ptr< adtf_file::SampleFactory > sample_factory,
std::shared_ptr< adtf_file::StreamTypeFactory > stream_type_factory )
overridevirtual

opens a file by the given filename. The given factories must be used to create samples and streamtypes for the getNextItem call

Parameters
filenameThe file to open
sample_factoryThe sample factory to create samples for the getNextItem call.
stream_type_factoryThe stream type factory to create streamtype for the getNextItem call.
Remarks
The Reader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
std::exceptionbased exception for any other implementation dependent case to identify error on open call

Implements adtf_file::Reader.

◆ unsortedSeekTo()

void adtfdat_processing::SortingProxyReader::unsortedSeekTo ( uint64_t item_index)
overridevirtual

Reimplemented from adtfdat_processing::SortingReader.


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