![]() |
ATLAS Offline Software
|
Forward iterator over an iterable of type V returning an object of type T.
More...
#include <ConstIter.h>
Public Member Functions | |
| ConstIter (const V &buf, size_t offset=0, std::function< T(const typename V::value_type &)> f=[](auto &x) ->T{return {x};}) | |
| Constructor. | |
| bool | operator== (const ConstIter &i) const |
| Comparison operator. | |
| ConstIter & | operator++ () |
| Pre-increment operator. | |
| const T & | operator* () const |
Dereference operator Creates object of type T from the current object in the container on the fly using the creation function m_f. | |
Private Attributes | |
| const V & | m_buf |
| Const reference to the underlying data container. | |
| std::size_t | m_offset |
| Current position of the iterator. | |
| CxxUtils::CachedValue< T > | m_data |
| Holder of the transformed data. | |
| std::function< T(const typename V::value_type &)> | m_f |
| Function to turn a single datum from the container into the output type. | |
| V::const_iterator | m_bufIt |
| Iterator over the container. | |
Forward iterator over an iterable of type V returning an object of type T.
By its nature this is a generator, returning values of type T, computed on the fly https://en.wikipedia.org/wiki/Generator_(computer_programming)
Objects of type T must be creatable from V::value_type, either by having a constuctor T(V::valuetype) or by supplying an explicit conversion function to the constructor of the iterator
This is being used by HLTMenu, L1Menu, and L1TopoMenu
Definition at line 31 of file ConstIter.h.
|
inline |
Constructor.
| buf | Reference to the underlying iterable data container |
| offset | Position of the current element at construction time |
| f | Function to create an object of type T from type V::value_type, the default calls a contstructor T(V::value_type) |
Iterators pointing to the front and back of the container, assuming that T can be created from the elements of V are created like this
An example for iterating over chains of an HLTMenu
Definition at line 52 of file ConstIter.h.
|
inline |
|
inline |
Pre-increment operator.
Definition at line 68 of file ConstIter.h.
|
inline |
|
private |
Const reference to the underlying data container.
Definition at line 86 of file ConstIter.h.
|
private |
Iterator over the container.
Definition at line 90 of file ConstIter.h.
|
private |
Holder of the transformed data.
Definition at line 88 of file ConstIter.h.
|
private |
Function to turn a single datum from the container into the output type.
Definition at line 89 of file ConstIter.h.
|
private |
Current position of the iterator.
Definition at line 87 of file ConstIter.h.