Project
Loading...
Searching...
No Matches
o2::framework::InputRecordWalker Class Reference

A helper class to iteratate over all parts of all input routes. More...

#include <InputRecordWalker.h>

Classes

class  Iterator
 

Public Types

using const_iterator = Iterator< DataRef const >
 

Public Member Functions

 InputRecordWalker ()=delete
 
 InputRecordWalker (InputRecord &record, std::vector< InputSpec > filterSpecs={})
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

A helper class to iteratate over all parts of all input routes.

Each input route can have multiple parts per input route and computation. This class allows simple iteration over all parts available in the computation. Optionally, a filter can be used to define valid parts and ignore all parts not matching the filter.

The iterator has DataRef as value type.

Usage: // 'inputs' refers to the DPL InputRecord instance returned by // ProcessingContext::inputs()

// iterate over all parts for (auto const& ref : InputRecordWalker(inputs)) { // do something with the data described by the DataRef object, e.g. auto data = inputs.get<TYPE>(ref) }

// iterate with a filter std::vector<InputSpec> filter{ {"tpc", "TPC", "SOMEDATA", 0, Lifetime::Timeframe}, {"its", ConcreteDataTypeMatcher{"ITS", "SOMEDATA"}, Lifetime::Timeframe}, }; for (auto const& ref : InputRecordWalker(inputs, filter)) { // do something with the data }

Definition at line 52 of file InputRecordWalker.h.

Member Typedef Documentation

◆ const_iterator

Constructor & Destructor Documentation

◆ InputRecordWalker() [1/2]

o2::framework::InputRecordWalker::InputRecordWalker ( )
delete

◆ InputRecordWalker() [2/2]

o2::framework::InputRecordWalker::InputRecordWalker ( InputRecord record,
std::vector< InputSpec filterSpecs = {} 
)
inline

Definition at line 56 of file InputRecordWalker.h.

Member Function Documentation

◆ begin()

const_iterator o2::framework::InputRecordWalker::begin ( ) const
inline

Definition at line 160 of file InputRecordWalker.h.

◆ end()

const_iterator o2::framework::InputRecordWalker::end ( ) const
inline

Definition at line 165 of file InputRecordWalker.h.


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