AliPhysics  2c6b7ad (2c6b7ad)
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator Class Referencefinal

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

#include <AliEmcalIterableContainer.h>

Inheritance diagram for EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator:

Public Member Functions

 iterator (const AliEmcalIterableContainerT< T, STAR > *cont, int currentpos, bool forward=true)
 Content of class AliEmcalIterableContainerT<T, STAR>::Iterator ///. More...
 
 iterator (const iterator &ref)
 
iteratoroperator= (const iterator &ref)
 
 ~iterator ()
 
bool operator!= (const iterator &ref) const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 
STAR::star_return_type operator* ()
 
STAR::arrow_return_type operator-> ()
 
int current_index () const
 
const AliTLorentzVectorget_momentum () const
 

Private Member Functions

 iterator ()
 
void update_current_element ()
 

Private Attributes

const AliEmcalIterableContainerT< T, STAR > * fkData
 container with data More...
 
int fCurrent
 current index in the container More...
 
bool fForward
 use forward or backward direction More...
 
momentum_object_pair fCurrentElement
 current element pair (momentum, pointer object) More...
 

Detailed Description

template<typename T, typename STAR = operator_star_object<T>>
class EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 118 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

template<typename T , typename STAR >
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::iterator ( const AliEmcalIterableContainerT< T, STAR > *  cont,
int  currentpos,
bool  forward = true 
)

Content of class AliEmcalIterableContainerT<T, STAR>::Iterator ///.

Constructor of the iterator. Setting underlying data, starting position of the iterator, and direction.

Iterators should be constructed by the iterable container via the functions begin, end, rbegin and rend. Direct use of the constructor by the users is discouraged.

Parameters
[in]contEMCAL container to iterate over
[in]currentposstarting position for the iteration
[in]forwardDirection of the iteration. If true, the iteration is performed in forward direction, otherwise in backward direction.

Definition at line 360 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::iterator ( const iterator ref)
template<typename T, typename STAR = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::~iterator ( )
inline

Definition at line 123 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::iterator ( )
private

Member Function Documentation

template<typename T, typename STAR = operator_star_object<T>>
int EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::current_index ( ) const
inline

Definition at line 135 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
const AliTLorentzVector& EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::get_momentum ( ) const
inline

Definition at line 136 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
bool EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 407 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
STAR::star_return_type EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator* ( )
inline

Definition at line 132 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
AliEmcalIterableContainerT< T, STAR >::iterator & EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 417 of file AliEmcalIterableContainer.h.

Referenced by EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator++().

template<typename T , typename STAR >
AliEmcalIterableContainerT< T, STAR >::iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator++ ( int  index)

Postfix increment operator. Incrementing / decrementing the position of the iterator based on the direction. This operator requires a copy of itself.

Parameters
[in]indexNot used
Returns
State of the iterator before incrementation

Definition at line 449 of file AliEmcalIterableContainer.h.

template<typename T , typename STAR >
AliEmcalIterableContainerT< T, STAR >::iterator & EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 432 of file AliEmcalIterableContainer.h.

Referenced by EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator--().

template<typename T , typename STAR >
AliEmcalIterableContainerT< T, STAR >::iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator-- ( int  index)

Postfix decrement operator. Decrementing / incrementing the position of the iterator based on the direction. This operator requires a copy of itself.

Parameters
[in]indexNot used
Returns
State of the iterator before decrementation.

Definition at line 463 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
STAR::arrow_return_type EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator-> ( )
inline

Definition at line 133 of file AliEmcalIterableContainer.h.

template<typename T, typename STAR = operator_star_object<T>>
AliEmcalIterableContainerT< T, STAR >::iterator & EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::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 391 of file AliEmcalIterableContainer.h.

Member Data Documentation

template<typename T, typename STAR = operator_star_object<T>>
momentum_object_pair EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::fCurrentElement
private

current element pair (momentum, pointer object)

Definition at line 144 of file AliEmcalIterableContainer.h.

Referenced by EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::iterator().

template<typename T, typename STAR = operator_star_object<T>>
const AliEmcalIterableContainerT<T, STAR>* EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::fkData
private

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