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

#include <demultiplexer.h>

Public Member Functions

 Demultiplexer (std::shared_ptr< adtf_file::Reader > reader, const ProcessorFactories &processor_factories)
 
void setTimeRange (const std::optional< std::chrono::nanoseconds > &time_start, const std::optional< std::chrono::nanoseconds > &time_end)
 
void addProcessor (const std::string &stream_name, const std::string &processor_id, const std::string &destination_url, const adtf_file::Configuration &configuration)
 
void addProcessor (const std::string &stream_name, const std::string &substream_name, const std::string &processor_id, const std::string &destination_url, const adtf_file::Configuration &configuration)
 
void process (const std::function< bool(double)> &progress_handler={})
 

Detailed Description

This one demultiplexes the streams of an ADTFDAT file (or any other adtf_file::Reader), and passes the stream items to Processor implementations.

Constructor & Destructor Documentation

◆ Demultiplexer()

adtfdat_processing::Demultiplexer::Demultiplexer ( std::shared_ptr< adtf_file::Reader > reader,
const ProcessorFactories & processor_factories )

Initializes the demultiplexer

Parameters
[in]readerThe source reader.
[in]processor_factoriesFactories for processors, these are used by addProcessor.

Member Function Documentation

◆ addProcessor() [1/2]

void adtfdat_processing::Demultiplexer::addProcessor ( const std::string & stream_name,
const std::string & processor_id,
const std::string & destination_url,
const adtf_file::Configuration & configuration )

Adds a processor for a given stream.

Parameters
[in]stream_nameThe name of the stream.
[in]processor_idThe identifier of the processor implementation.
[in]destination_urlThe output URL.
[in]configurationThe configuration of the processor.

◆ addProcessor() [2/2]

void adtfdat_processing::Demultiplexer::addProcessor ( const std::string & stream_name,
const std::string & substream_name,
const std::string & processor_id,
const std::string & destination_url,
const adtf_file::Configuration & configuration )

Adds a processor for a given substream.

Parameters
[in]stream_nameThe name of the stream.
[in]substream_nameThe name of the substream within stream.
[in]processor_idThe identifier of the processor implementation.
[in]destination_urlThe output URL.
[in]configurationThe configuration of the processor.

◆ process()

void adtfdat_processing::Demultiplexer::process ( const std::function< bool(double)> & progress_handler = {})

Processes all selected streams.

Parameters
[in,out]progress_handlerA callback that is called for each prosessed stream item. The value passed to thes method is in the range [0.0, 1.0]. Processing will be canceled if this returns false.

◆ setTimeRange()

void adtfdat_processing::Demultiplexer::setTimeRange ( const std::optional< std::chrono::nanoseconds > & time_start,
const std::optional< std::chrono::nanoseconds > & time_end )

Set cut time range. Reset to 'no cutting' with '{}' or 'std::nullopt'. All samples with a timestamp dating before 'time_start' will be discarded while processing the file. All samples with a timestamp dating after 'time_end' will be discarded while processing the file.

Parameters
[in]time_startTime in nanoseconds [ns] = 10^-9 [s]
[in]time_endTime in nanoseconds [ns] = 10^-9 [s]

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