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

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

#include <AliEmcalIterableContainer.h>

Inheritance diagram for AliEmcalIterableContainerT< T, mom >::iterator:

Public Member Functions

 iterator (const AliEmcalIterableContainerT< T, mom > *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)
 
int current_index () const
 
const AliTLorentzVector & get_momentum () const
 

Private Member Functions

 iterator ()
 
void update_current_element ()
 

Private Attributes

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

Detailed Description

template<typename T, bool mom = false>
class AliEmcalIterableContainerT< T, mom >::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 114 of file AliEmcalIterableContainer.h.

Constructor & Destructor Documentation

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

Definition at line 120 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
AliEmcalIterableContainerT< T, mom >::iterator::iterator ( )
private

Member Function Documentation

template<typename T, bool mom = false>
int AliEmcalIterableContainerT< T, mom >::iterator::current_index ( ) const
inline

Definition at line 129 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
const AliTLorentzVector& AliEmcalIterableContainerT< T, mom >::iterator::get_momentum ( ) const
inline

Definition at line 130 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
bool AliEmcalIterableContainerT< T, mom >::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 388 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
AliEmcalIterableContainerT< T, mom >::iterator & AliEmcalIterableContainerT< T, mom >::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 398 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::iterator::operator++ ( int  )
template<typename T, bool mom = false>
AliEmcalIterableContainerT< T, mom >::iterator & AliEmcalIterableContainerT< T, mom >::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 413 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
iterator AliEmcalIterableContainerT< T, mom >::iterator::operator-- ( int  )
template<typename T, bool mom = false>
AliEmcalIterableContainerT< T, mom >::iterator & AliEmcalIterableContainerT< T, mom >::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 372 of file AliEmcalIterableContainer.h.

template<typename T, bool mom = false>
void AliEmcalIterableContainerT< T, mom >::iterator::update_current_element ( )
inlineprivate

Definition at line 139 of file AliEmcalIterableContainer.h.

Member Data Documentation

template<typename T, bool mom = false>
bool AliEmcalIterableContainerT< T, mom >::iterator::fForward
private

use forward or backward direction

Definition at line 137 of file AliEmcalIterableContainer.h.

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


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