![]() |
AliPhysics
9d9c621 (9d9c621)
|
stl iterator over accepted clusters More...
#include <AliParticleContainer.h>
Public Member Functions | |
accept_iterator (const AliParticleContainer *cont, int startpos, bool forward=true) | |
accept_iterator (const accept_iterator &other) | |
~accept_iterator () | |
accept_iterator & | operator= (const accept_iterator &other) |
bool | operator!= (const accept_iterator &other) const |
accept_iterator & | operator++ () |
accept_iterator | operator++ (int) |
accept_iterator & | operator-- () |
accept_iterator | operator-- (int) |
AliVParticle * | operator* () const |
Private Member Functions | |
accept_iterator () | |
Private Attributes | |
const AliParticleContainer * | fkContainer |
Container iterated over. More... | |
TArrayI | fAcceptIndices |
Indices of accepted clusters. More... | |
int | fCurrentPos |
Current position inside the container. More... | |
bool | fForward |
Direction, expressed in forward direction. More... | |
stl iterator over accepted clusters
Bi-directional iterator over all accepted particles in the array. The iterator is used in the standard way a c++ iterator is used. The container is responsible creating it. Afterwards one uses the prefix or postfix increment or decrement operator, depending on the direction of the iteration.
As the postfix operator needs to perform a copy of the iterator, the prefix operator will have a better performance and should be preferred.
Note: This class is using a list of accepted clusters in the backend. This list is copied in the copy constructor and the assignment operator. Can be done in a more performant way using c++11 shared_ptr.
Definition at line 56 of file AliParticleContainer.h.
AliParticleContainer::accept_iterator::accept_iterator | ( | const AliParticleContainer * | cont, |
int | start, | ||
bool | forward = true |
||
) |
Content of accept_iterator Constructor, inializing the iterator with
Note: Iterators should be created by the object it iterates over and not by hand.
[in] | cont | Container to be iterated over (not modified) |
[in] | start | Start position for the iteration |
[in] | forward | If true iterator is a forward iterator |
Definition at line 510 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator::accept_iterator | ( | const accept_iterator & | other | ) |
Copy constructor. For the underlying container the pointer is copied.
[in] | other | Reference for the copy |
Definition at line 534 of file AliParticleContainer.cxx.
|
inline |
Definition at line 63 of file AliParticleContainer.h.
|
private |
bool AliParticleContainer::accept_iterator::operator!= | ( | const accept_iterator & | other | ) | const |
Comparison operator. The comparison is performed based on the current position of the iterator.
[in] | other | Object to compare to. |
Definition at line 564 of file AliParticleContainer.cxx.
AliVParticle * AliParticleContainer::accept_iterator::operator* | ( | ) | const |
Dereferencing operator. Providing access to the accepted cluster at the current position.
Definition at line 625 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator & AliParticleContainer::accept_iterator::operator++ | ( | ) |
Incrementation prefix operator. Incrementing/Decrementing the postion of the iterator in the array based on the direction.
Definition at line 573 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator AliParticleContainer::accept_iterator::operator++ | ( | int | ) |
Incrementation postfix operator. Incrementing/Decrementing the postion of the iterator in the array based on the direction.
[in] | Not | used, only defining the operator as postfix operator |
Definition at line 588 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator & AliParticleContainer::accept_iterator::operator-- | ( | ) |
Decrementation prefix operator. Decrementing/Incrementing the postion of the iterator in the array based on the direction.
Definition at line 599 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator AliParticleContainer::accept_iterator::operator-- | ( | int | ) |
Decrementation postfix operator. Decrementing/Incrementing the postion of the iterator in the array based on the direction.
[in] | Not | used, only defining the operator as postfix operator |
Definition at line 614 of file AliParticleContainer.cxx.
AliParticleContainer::accept_iterator & AliParticleContainer::accept_iterator::operator= | ( | const accept_iterator & | other | ) |
Assignmet operator, copying properties of the reference iterator
[in] | other | Reference for the assignment |
Definition at line 548 of file AliParticleContainer.cxx.
|
private |
Indices of accepted clusters.
Definition at line 78 of file AliParticleContainer.h.
Referenced by accept_iterator(), and operator=().
|
private |
Current position inside the container.
Definition at line 79 of file AliParticleContainer.h.
Referenced by operator!=(), and operator=().
|
private |
Direction, expressed in forward direction.
Definition at line 80 of file AliParticleContainer.h.
Referenced by operator=().
|
private |
Container iterated over.
Definition at line 77 of file AliParticleContainer.h.
Referenced by accept_iterator(), and operator=().