AliPhysics  0b37c46 (0b37c46)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 
 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 = operator_star_object<T>>
EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::iterator ( const AliEmcalIterableContainerT< T, STAR > *  cont,
int  currentpos,
bool  forward = true 
)
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 = operator_star_object<T>>
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.

template<typename T, typename STAR = operator_star_object<T>>
iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator++ ( int  )
template<typename T, typename STAR = operator_star_object<T>>
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.

template<typename T, typename STAR = operator_star_object<T>>
iterator EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::operator-- ( int  )
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.

template<typename T, typename STAR = operator_star_object<T>>
void EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::update_current_element ( )
inlineprivate

Member Data Documentation

template<typename T, typename STAR = operator_star_object<T>>
bool EMCALIterableContainer::AliEmcalIterableContainerT< T, STAR >::iterator::fForward
private

use forward or backward direction

Definition at line 143 of file AliEmcalIterableContainer.h.

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


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