adtf_file_library  0.13.1
Public Member Functions | List of all members
adtfdat_processing::OffsetReaderWrapper Class Reference

#include <multiplexer.h>

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

Public Member Functions

 OffsetReaderWrapper (const std::shared_ptr< Reader > original_reader, std::chrono::nanoseconds offset, std::chrono::nanoseconds start_offset, std::chrono::nanoseconds end_offset)
 
std::string getReaderIdentifier () const override
 Get the Reader Identifier of the Reader. More...
 
uint32_t getFileVersion () const override
 
std::string getDescription () const override
 
void open (const std::string &filename, 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 More...
 
void setConfiguration (const adtf_file::Configuration &configuration) override
 
const adtf_file::ConfigurationgetConfiguration () const override
 
std::vector< adtf_file::ExtensiongetExtensions () const override
 Get the Extensions if any. More...
 
std::vector< adtf_file::StreamgetStreams () const override
 Get the Streams. More...
 
adtf_file::FileItem getNextItem () 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. More...
 
std::optional< double > getProgress () const override
 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.
 

Detailed Description

Helper wrapper that optionally applies a timestamp offset and limits items to a given time range.

Constructor & Destructor Documentation

◆ OffsetReaderWrapper()

adtfdat_processing::OffsetReaderWrapper::OffsetReaderWrapper ( const std::shared_ptr< Reader >  original_reader,
std::chrono::nanoseconds  offset,
std::chrono::nanoseconds  start_offset,
std::chrono::nanoseconds  end_offset 
)

Initializes a new wrapper

Parameters
[in]original_readerThe reader that does the heavy lifting.
[in]offsetThe offset that is added to all timestamps.
[in]start_offsetItems before this (without the offset applied) will be skipped.
[in]end_offsetItems after this will be dropped.

Member Function Documentation

◆ getConfiguration()

const adtf_file::Configuration& adtfdat_processing::OffsetReaderWrapper::getConfiguration ( ) const
overridevirtual
Returns
The configuration (a set of properties) of the object.

Reimplemented from adtf_file::Configurable.

◆ getDescription()

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

Reimplemented from adtf_file::Reader.

◆ getExtensions()

std::vector<adtf_file::Extension> adtfdat_processing::OffsetReaderWrapper::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::OffsetReaderWrapper::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::OffsetReaderWrapper::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.

◆ getNextItem()

adtf_file::FileItem adtfdat_processing::OffsetReaderWrapper::getNextItem ( )
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.
Remarks
Use the given factories from the open call to create sample and streamtypes.
The Reader class is an interface where implementation should at least throw following exceptions in case of error:
Exceptions
exceptions::EndOfFileif end of file was reached
std::exceptionbased exception for any other implementation dependent case to identify error on getNextItem call

Implements adtf_file::Reader.

◆ getProgress()

std::optional<double> adtfdat_processing::OffsetReaderWrapper::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::OffsetReaderWrapper::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::OffsetReaderWrapper::getStreams ( ) const
overridevirtual

Get the Streams.

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

Reimplemented from adtf_file::Reader.

◆ open()

void adtfdat_processing::OffsetReaderWrapper::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.

◆ setConfiguration()

void adtfdat_processing::OffsetReaderWrapper::setConfiguration ( const adtf_file::Configuration configuration)
overridevirtual

Sets the configuration to be used by the object during processing.

Parameters
[in]configurationThe configuration.

Reimplemented from adtf_file::Configurable.


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