Belle II Software light-2406-ragdoll
|
Optimizes class to iterate over TObjArray and classes inheriting from it. More...
#include <ArrayIterator.h>
Public Types | |
using | iterator_category = std::forward_iterator_tag |
Iterator category. | |
using | difference_type = std::ptrdiff_t |
Difference type. | |
using | value_type = ValueType |
Value type. | |
using | pointer = ValueType * |
Pointer. | |
using | reference = ValueType & |
Reference. | |
Public Member Functions | |
ObjArrayIterator ()=default | |
default constructor | |
ObjArrayIterator (ArrayType &array, size_t index) | |
real constructor | |
ObjArrayIterator (ArrayType const *array, bool end=false) | |
Convenience constructor in case of a TClonesArray pointer. | |
ObjArrayIterator (ArrayType const *const *array, bool end=false) | |
Convenience constructor because we usually have a TClonesArray** member so this takes cares of the checks. | |
ObjArrayIterator< ArrayType, ValueType > & | operator++ () |
prefix increment | |
ObjArrayIterator< ArrayType, ValueType > | operator++ (int) |
postfix increment | |
bool | operator== (const ObjArrayIterator< ArrayType, ValueType > &rhs) const |
check equality. | |
bool | operator!= (const ObjArrayIterator< ArrayType, ValueType > &rhs) const |
check inequality. | |
ValueType & | operator* () const |
dereference. | |
ValueType * | operator-> () const |
dereference. | |
Private Attributes | |
TObject ** | m_array {nullptr} |
pointer to the fCont member of the TObjArray | |
Optimizes class to iterate over TObjArray and classes inheriting from it.
iterators are invalidated if the size of the TObjArray is changed.
Definition at line 23 of file ArrayIterator.h.
using difference_type = std::ptrdiff_t |
Difference type.
Definition at line 31 of file ArrayIterator.h.
using iterator_category = std::forward_iterator_tag |
Iterator category.
Definition at line 28 of file ArrayIterator.h.
using pointer = ValueType* |
Pointer.
Definition at line 37 of file ArrayIterator.h.
using reference = ValueType& |
Reference.
Definition at line 40 of file ArrayIterator.h.
using value_type = ValueType |
Value type.
Definition at line 34 of file ArrayIterator.h.
|
inline |
real constructor
array | reference to the TObjArray instance we want to iterate over |
index | integer of the index we want to point to right away |
Definition at line 48 of file ArrayIterator.h.
|
inlineexplicit |
Convenience constructor in case of a TClonesArray pointer.
The "const *" is needed so that a const TClonesArray* can be passed in for const ObjArrayIterators
array | pointer to where the array is located. If any of the two is NULL a default iterator is created |
end | if true point to after the array, otherwise point to the beginning |
Definition at line 57 of file ArrayIterator.h.
|
inlineexplicit |
Convenience constructor because we usually have a TClonesArray** member so this takes cares of the checks.
The "const * const *" is needed so that a const TClonesArray** can be passed in for const ObjArrayIterators
array | pointer to the pointer where the array is located. If any of the two is NULL a default iterator is created |
end | if true point to after the array, otherwise point to the beginning |
Definition at line 71 of file ArrayIterator.h.
|
inline |
|
inline |
dereference.
Definition at line 82 of file ArrayIterator.h.
|
inline |
|
inline |
postfix increment
Definition at line 75 of file ArrayIterator.h.
|
inline |
dereference.
Definition at line 84 of file ArrayIterator.h.
|
inline |
|
private |
pointer to the fCont member of the TObjArray
Definition at line 87 of file ArrayIterator.h.