![]() |
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 (ConcreteDataMatcher matcher) 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 | getAtIndices (int pos, DataRefIndices indices) const |
| O(1) access to the part described by indices in slot pos. | |
| DataRefIndices | nextIndices (int pos, DataRefIndices current) const |
| O(1) advance from current to the next part's indices in slot pos. | |
| 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 |
| template<typename T > requires (std::same_as<T, DataRef>) | |
| decltype(auto) | get (ConcreteDataMatcher matcher, int part=0) |
| template<typename T > requires (std::same_as<T, TableConsumer>) | |
| decltype(auto) | get (ConcreteDataMatcher matcher, int part=0) |
| 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 102 of file InputRecord.h.
| using o2::framework::InputRecord::const_iterator = InputRecordIterator<const DataRef> |
Definition at line 743 of file InputRecord.h.
Definition at line 105 of file InputRecord.h.
Definition at line 742 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 745 of file InputRecord.h.
| size_t o2::framework::InputRecord::countValidInputs | ( | ) | const |
Definition at line 178 of file InputRecord.cxx.
|
inline |
Definition at line 750 of file InputRecord.h.
|
inline |
Definition at line 527 of file InputRecord.h.
|
inline |
Definition at line 539 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 259 of file InputRecord.h.
|
inline |
Definition at line 483 of file InputRecord.h.
| DataRef o2::framework::InputRecord::getAtIndices | ( | int | pos, |
| DataRefIndices | indices | ||
| ) | const |
O(1) access to the part described by indices in slot pos.
Definition at line 143 of file InputRecord.cxx.
Definition at line 86 of file InputRecord.cxx.
|
static |
Definition at line 91 of file InputRecord.cxx.
|
inline |
Definition at line 216 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 120 of file InputRecord.cxx.
| size_t o2::framework::InputRecord::getNofParts | ( | int | pos | ) | const |
Definition at line 135 of file InputRecord.cxx.
| int o2::framework::InputRecord::getPos | ( | ConcreteDataMatcher | matcher | ) | const |
Definition at line 61 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 81 of file InputRecord.cxx.
|
static |
Definition at line 66 of file InputRecord.cxx.
Definition at line 228 of file InputRecord.h.
Definition at line 235 of file InputRecord.h.
Definition at line 242 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 157 of file InputRecord.cxx.
| bool o2::framework::InputRecord::isValid | ( | int | pos | ) | const |
Definition at line 166 of file InputRecord.cxx.
|
inline |
Helper method to be used to check if a given part of the InputRecord is present.
Definition at line 547 of file InputRecord.h.
|
inline |
O(1) advance from current to the next part's indices in slot pos.
Definition at line 210 of file InputRecord.h.
| size_t o2::framework::InputRecord::size | ( | ) | const |
Definition at line 152 of file InputRecord.cxx.
|
inline |
Definition at line 755 of file InputRecord.h.