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. More... | |
bool | operator== (const ConstIter &i) const |
Comparison operator. More... | |
bool | operator!= (const ConstIter &i) const |
Not-equal operator. More... | |
ConstIter & | operator++ () |
Pre-increment operator. More... | |
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 . More... | |
Private Attributes | |
const V & | m_buf |
Const reference to the underlying data container. More... | |
std::size_t | m_offset |
Current position of the iterator. More... | |
CxxUtils::CachedValue< T > | m_data |
Holder of the transformed data. More... | |
std::function< T(const typename V::value_type &)> | m_f |
Function to turn a single datum from the container into the output type. More... | |
V::const_iterator | m_bufIt |
Iterator over the container. More... | |
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 32 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 53 of file ConstIter.h.
|
inline |
|
inline |
|
inline |
Pre-increment operator.
Definition at line 73 of file ConstIter.h.
|
inline |
|
private |
Const reference to the underlying data container.
Definition at line 91 of file ConstIter.h.
|
private |
Iterator over the container.
Definition at line 95 of file ConstIter.h.
|
private |
Holder of the transformed data.
Definition at line 93 of file ConstIter.h.
|
private |
Function to turn a single datum from the container into the output type.
Definition at line 94 of file ConstIter.h.
|
private |
Current position of the iterator.
Definition at line 92 of file ConstIter.h.