CxxUtils::ArrayIterator< N > Class Template Reference
Iterator class for Array<N>
.
More...
#include <Array.h>
List of all members.
Detailed Description
template<unsigned int N>
class CxxUtils::ArrayIterator< N >
Iterator class for Array<N>
.
This serves as an iterator class for Array<N>
, where N
>= 2. It gives a Array<N-1>
as value_type
. Only const
access is supported.
This class is almost, but not quite, a random access iterator. operator*
and operator
[] returns a value_type
instead of a reference
. And operator->
returns a proxy. (The issues here are similar to those encountered with std::vector<bool>
.) But it should mostly work as you expect.
Constructor & Destructor Documentation
Constructor from Arrayrep
and offset.
- Parameters:
-
| rep | The underlying array representation. |
| offs | The offset in the representation of the first element referenced by this iterator. |
Member Function Documentation
Inequality comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if the iterators are not equal.
Dereference the iterator.
- Returns:
- The value that the iterator points to. Note that this method returns a
value_type
, not a reference
. (Thus, this class does not quite conform to the iterator requirements.)
Return a new iterator pointing n steps ahead.
- Parameters:
-
| n | Number of steps by which to advance. |
- Returns:
- The new iterator.
Advance the iterator.
- Returns:
- The iterator before being advanced.
Advance the iterator.
- Returns:
- This iterator.
Advance the iterator.
- Parameters:
-
| n | Number of steps by which to advance the iterator. |
- Returns:
- This iterator.
Return the difference between two iterators.
- Parameters:
-
| other | The other iterator for the comparison. |
- Returns:
- The number of elements difference between this iterator and other. Undefined if the two iterators do not point into the same array.
Return a new iterator pointing n steps behind.
- Parameters:
-
| n | Number of steps by which to back up. |
- Returns:
- The new iterator.
Back up the iterator.
- Returns:
- The iterator before being backed up.
Back up the iterator.
- Returns:
- This iterator.
Back up the iterator.
- Parameters:
-
| n | Number of steps by which to advance the iterator. |
- Returns:
- This iterator.
Dereference the iterator.
- Returns:
- A proxy for the iterator element.
This method will return a proxy for the array, which you can then dereference. Note that if you get a C++ pointer from this, then it will be valid only until the proxy object gets destroyed.
Less-than comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if this iterator is less than other. This will always return false for iterators over different arrays.
Less-than-or-equal comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if this iterator is less than or equal to other. This will always return false for iterators over different arrays.
Equality comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if the iterators are equal.
Greater-than comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if this iterator is greater than other. This will always return false for iterators over different arrays.
Greater-than-or-equal comparison.
- Parameters:
-
| other | The other object with which to compare. |
- Returns:
- True if this iterator is less than or equal to other. This will always return false for iterators over different arrays.
Array indexing relative to the iterator.
- Parameters:
-
- Returns:
- The array item at an offset of n from the current iterator position. Note that this method returns a
value_type
, not a reference
. (Thus, this class does not quite conform to the iterator requirements.)
The documentation for this class was generated from the following files:
- /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.31/CxxUtils/CxxUtils/Array.h
- /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.31/CxxUtils/CxxUtils/Array.icc