![]() |
Project
|
The input API of the Data Processing Layer This class holds the inputs which are valid for processing. The user can get an instance for it via the ProcessingContext and can use it to retrieve the inputs, either by name or by index. A few utility methods are provided to automatically cast the (deserialized) inputs to known types. More...
#include <InputRecord.h>
Classes | |
class | Deleter |
struct | InputPos |
class | InputRecordIterator |
class | Iterator |
Public Types | |
using | DataHeader = o2::header::DataHeader |
using | iterator = InputRecordIterator< DataRef > |
using | const_iterator = InputRecordIterator< const DataRef > |
Public Member Functions | |
InputRecord (std::vector< InputRoute > const &inputs, InputSpan &span, ServiceRegistryRef) | |
int | getPos (const char *name) const |
int | getPos (const std::string &name) const |
DataRef | getByPos (int pos, int part=0) const |
DataRef | getFirstValid (bool throwOnFailure=false) const |
Get the ref of the first valid input. If requested, throw an error if none is found. | |
size_t | getNofParts (int pos) const |
DataRef | getDataRefByString (const char *bindingName, int part=0) const |
template<typename R > requires std::is_convertible_v<R, char const*> | |
DataRef | getRef (R binding, int part=0) const |
template<typename R > requires requires(R r) { r.c_str(); } | |
DataRef | getRef (R binding, int part=0) const |
template<typename R > requires std::is_convertible_v<R, DataRef> | |
DataRef | getRef (R ref, int part=0) const |
template<typename T = DataRef, typename R > | |
decltype(auto) | get (R binding, int part=0) const |
template<typename T = DataRef, typename R > requires std::same_as<T, CCDBMetadataExtractor> | |
std::map< std::string, std::string > & | get (R binding, int part=0) const |
bool | isValid (std::string const &s) const |
Helper method to be used to check if a given part of the InputRecord is present. | |
bool | isValid (char const *s) const |
Helper method to be used to check if a given part of the InputRecord is present. | |
bool | isValid (int pos) const |
size_t | size () const |
size_t | countValidInputs () const |
const_iterator | begin () const |
const_iterator | end () const |
InputSpan & | span () |
Static Public Member Functions | |
static InputPos | getPos (std::vector< InputRoute > const &routes, ConcreteDataMatcher matcher) |
static DataRef | getByPos (std::vector< InputRoute > const &routes, InputSpan const &span, int pos, int part=0) |
The input API of the Data Processing Layer This class holds the inputs which are valid for processing. The user can get an instance for it via the ProcessingContext and can use it to retrieve the inputs, either by name or by index. A few utility methods are provided to automatically cast the (deserialized) inputs to known types.
auto& v1 = get<int>("input1"); auto v2 = get<vector<int>>("input2"); auto v3 = get<TList*>("input3"); auto v4 = get<vector<TParticle>>("input4");
Iterator functionality is implemented to iterate over the list of DataRef objects, including begin() and end() methods.
for (auto const& ref : inputs) { // do something with DataRef object ref }
Definition at line 101 of file InputRecord.h.
using o2::framework::InputRecord::const_iterator = InputRecordIterator<const DataRef> |
Definition at line 700 of file InputRecord.h.
Definition at line 104 of file InputRecord.h.
Definition at line 699 of file InputRecord.h.
o2::framework::InputRecord::InputRecord | ( | std::vector< InputRoute > const & | inputs, |
InputSpan & | span, | ||
ServiceRegistryRef | registry | ||
) |
Definition at line 36 of file InputRecord.cxx.
|
inline |
Definition at line 702 of file InputRecord.h.
size_t o2::framework::InputRecord::countValidInputs | ( | ) | const |
Definition at line 163 of file InputRecord.cxx.
|
inline |
Definition at line 707 of file InputRecord.h.
|
inline |
Get the object of specified type T for the binding R. If R is a string like object, we look up by name the InputSpec and return the data associated to the given label. If R is a DataRef, we extract the result object from the Payload, following the information provided by the Header. The actual operation and cast depends on the target data type and the serialization type of the incoming data. By default we return a DataRef, which is the pair of pointers to the header and payload of the O2 Message. See Inputrecord class description for supported types.
ref | DataRef with pointers to input spec, header, and payload |
substitution for container of non-messageable objects with ROOT dictionary Notice that this will return a copy of the actual contents of the buffer, because the buffer is actually serialised. The extracted container is swaped to local, container, C++11 and beyond will implicitly apply return value optimization.
Definition at line 248 of file InputRecord.h.
|
inline |
Definition at line 472 of file InputRecord.h.
Definition at line 81 of file InputRecord.cxx.
|
static |
Definition at line 86 of file InputRecord.cxx.
|
inline |
Definition at line 205 of file InputRecord.h.
DataRef o2::framework::InputRecord::getFirstValid | ( | bool | throwOnFailure = false | ) | const |
Get the ref of the first valid input. If requested, throw an error if none is found.
Definition at line 115 of file InputRecord.cxx.
size_t o2::framework::InputRecord::getNofParts | ( | int | pos | ) | const |
Definition at line 130 of file InputRecord.cxx.
Definition at line 45 of file InputRecord.cxx.
int o2::framework::InputRecord::getPos | ( | const std::string & | name | ) | const |
Definition at line 76 of file InputRecord.cxx.
|
static |
Definition at line 61 of file InputRecord.cxx.
Definition at line 217 of file InputRecord.h.
Definition at line 224 of file InputRecord.h.
Definition at line 231 of file InputRecord.h.
bool o2::framework::InputRecord::isValid | ( | char const * | s | ) | const |
Helper method to be used to check if a given part of the InputRecord is present.
Definition at line 142 of file InputRecord.cxx.
bool o2::framework::InputRecord::isValid | ( | int | pos | ) | const |
Definition at line 151 of file InputRecord.cxx.
|
inline |
Helper method to be used to check if a given part of the InputRecord is present.
Definition at line 515 of file InputRecord.h.
size_t o2::framework::InputRecord::size | ( | ) | const |
Definition at line 137 of file InputRecord.cxx.
|
inline |
Definition at line 712 of file InputRecord.h.