AliPhysics  b24dc27 (b24dc27)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalIterableContainerT< T >::iterator Class Reference

bidirectional stl iterator over the EMCAL iterable container More...

#include <AliEmcalIterableContainer.h>

Inheritance diagram for AliEmcalIterableContainerT< T >::iterator:

Public Member Functions

 iterator (const AliEmcalIterableContainerT< T > *cont, int currentpos, bool forward=true)
 
 iterator (const iterator &ref)
 
iteratoroperator= (const iterator &ref)
 
virtual ~iterator ()
 
bool operator!= (const iterator &ref) const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 
T * operator* () const
 

Private Member Functions

 iterator ()
 

Private Attributes

const
AliEmcalIterableContainerT< T > * 
fkData
 container with data More...
 
int fCurrent
 current index in the container More...
 
bool fForward
 use forward or backward direction More...
 

Detailed Description

template<class T>
class AliEmcalIterableContainerT< T >::iterator

bidirectional stl iterator over the EMCAL iterable container

Author
Markus Fasel marku.nosp@m.s.fa.nosp@m.sel@c.nosp@m.ern..nosp@m.ch, Lawrence Berkeley National Laboratory
Date
March 23rd, 2016

stl iterator corresponding to the EMCAL iterable container. The iterator iterates over all object in the EMCAL iterable container as specified in its constructor (all or accepted). It can be both forward or backward iterator.

As stl iterator it implements the operators required for an iterator

  • operator!= to determine the end of the iteration
  • prefix and postfix operator++ and operator-- forwarding the position
  • operator* to access the content of the iteration

In case of c++11 the iterator also allows range-based iteration.

Definition at line 73 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

template<class T>
AliEmcalIterableContainerT< T >::iterator::iterator ( const AliEmcalIterableContainerT< T > *  cont,
int  currentpos,
bool  forward = true 
)
template<class T>
AliEmcalIterableContainerT< T >::iterator::iterator ( const iterator ref)
template<class T>
virtual AliEmcalIterableContainerT< T >::iterator::~iterator ( )
inlinevirtual

Definition at line 80 of file AliEmcalIterableContainer.h.

template<class T>
AliEmcalIterableContainerT< T >::iterator::iterator ( )
private

Member Function Documentation

template<class T>
bool AliEmcalIterableContainerT< T >::iterator::operator!= ( const iterator ref) const

Comparison operator for unequalness. Comparison is performed based on the position inside the container

Parameters
[in]refReference for comparison
Returns
True if the position does not match, false otherwise

Definition at line 333 of file AliEmcalIterableContainer.h.

template<class T>
T * AliEmcalIterableContainerT< T >::iterator::operator* ( ) const

Access operator. Providing access to the object at the position of the iterator.

Returns
Object at the position of the iterator (NULL if the iterator is out of range)

Definition at line 395 of file AliEmcalIterableContainer.h.

template<class T>
AliEmcalIterableContainerT< T >::iterator & AliEmcalIterableContainerT< T >::iterator::operator++ ( )

Prefix increment operator. Incrementing / decrementing position of the iterator based on the direction.

Returns
Status of the operator before incrementation.

Definition at line 343 of file AliEmcalIterableContainer.h.

template<class T>
iterator AliEmcalIterableContainerT< T >::iterator::operator++ ( int  )
template<class T>
AliEmcalIterableContainerT< T >::iterator & AliEmcalIterableContainerT< T >::iterator::operator-- ( )

Prefix decrement operator. Decrementing / incrementing the position of the iterator based on the direction.

Returns
Status of the iterator before decrementation.

Definition at line 355 of file AliEmcalIterableContainer.h.

template<class T>
iterator AliEmcalIterableContainerT< T >::iterator::operator-- ( int  )
template<class T>
AliEmcalIterableContainerT< T >::iterator & AliEmcalIterableContainerT< T >::iterator::operator= ( const iterator ref)

Assignment operator. Only pointers are copied as the iterator does not own its container.

Parameters
[in]refReference for the assignment
Returns
This iterator after assignment

Definition at line 318 of file AliEmcalIterableContainer.h.

Member Data Documentation

template<class T>
int AliEmcalIterableContainerT< T >::iterator::fCurrent
private
template<class T>
bool AliEmcalIterableContainerT< T >::iterator::fForward
private

use forward or backward direction

Definition at line 96 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalIterableContainerT< T >::iterator::operator=().

template<class T>
const AliEmcalIterableContainerT<T>* AliEmcalIterableContainerT< T >::iterator::fkData
private

container with data

Definition at line 94 of file AliEmcalIterableContainer.h.

Referenced by AliEmcalIterableContainerT< T >::iterator::operator=().


The documentation for this class was generated from the following file: