60 m_array = array->GetObjectRef() + (end ? array->GetEntriesFast() : 0);
82 ValueType&
operator*()
const {
return *
static_cast<ValueType*
>(*m_array); }
158 return !(*
this == rhs);
Generic iterator class for arrays, allowing use of STL algorithms, range-based for etc.
ValueType & operator*() const
Dereference.
ArrayIterator< ArrayType, ValueType > operator++(int)
Postfix increment.
ValueType * operator->() const
Dereference.
ArrayIterator< ArrayType, ValueType > & operator++()
Prefix increment.
ValueType value_type
Value type.
static ValueType & deref_if_needed(ValueType &t)
Dereference if argument is a pointer to ValueType.
bool operator!=(const ArrayIterator< ArrayType, ValueType > &rhs) const
Check inequality.
std::forward_iterator_tag iterator_category
Iterator category.
ArrayIterator(const ArrayType *array, int index)
Constructor.
bool operator==(const ArrayIterator< ArrayType, ValueType > &rhs) const
Check equality.
static ValueType & deref_if_needed(ValueType *t)
Dereference if argument is a pointer to ValueType.
ValueType * pointer
Pointer.
std::ptrdiff_t difference_type
Difference type.
int m_index
Current index.
ValueType & reference
Reference.
ArrayIterator()
Default constructor (not that you can dereference these).
const ArrayType * m_array
Array to iterate over.
Optimizes class to iterate over TObjArray and classes inheriting from it.
ObjArrayIterator()=default
default constructor
ValueType & operator*() const
dereference.
ValueType * operator->() const
dereference.
ValueType value_type
Value type.
bool operator!=(const ObjArrayIterator< ArrayType, ValueType > &rhs) const
check inequality.
ObjArrayIterator(ArrayType &array, size_t index)
real constructor
std::forward_iterator_tag iterator_category
Iterator category.
bool operator==(const ObjArrayIterator< ArrayType, ValueType > &rhs) const
check equality.
ObjArrayIterator< ArrayType, ValueType > operator++(int)
postfix increment
ObjArrayIterator(ArrayType const *const *array, bool end=false)
Convenience constructor because we usually have a TClonesArray** member so this takes cares of the ch...
ValueType * pointer
Pointer.
TObject ** m_array
pointer to the fCont member of the TObjArray
std::ptrdiff_t difference_type
Difference type.
ObjArrayIterator(ArrayType const *array, bool end=false)
Convenience constructor in case of a TClonesArray pointer.
ValueType & reference
Reference.
ObjArrayIterator< ArrayType, ValueType > & operator++()
prefix increment
Abstract base class for different kinds of events.