latest version v1.9 - last update 10 Apr 2010 |
const iterator type (allows read-only operations). More...
#include <ltiGenericVector.h>
Public Member Functions | |
const_iterator () | |
const_iterator (const const_iterator &other) | |
const_iterator (const iterator &other) | |
const_iterator & | operator++ () |
const_iterator | operator++ (int) |
const_iterator & | operator-- () |
const_iterator | operator-- (int) |
const_iterator & | operator+= (const int n) |
const_iterator & | operator-= (const int n) |
const_iterator | operator+ (const int n) |
const_iterator | operator- (const int n) |
bool | operator== (const const_iterator &other) const |
bool | operator!= (const const_iterator &other) const |
bool | operator== (const iterator &other) const |
bool | operator!= (const iterator &other) const |
bool | operator< (const iterator &other) const |
bool | operator> (const iterator &other) const |
bool | operator<= (const iterator &other) const |
bool | operator>= (const iterator &other) const |
bool | operator< (const const_iterator &other) const |
bool | operator> (const const_iterator &other) const |
bool | operator<= (const const_iterator &other) const |
bool | operator>= (const const_iterator &other) const |
const T & | operator* () |
const T & | operator[] (const int i) |
const_iterator & | operator= (const const_iterator &other) |
const_iterator & | operator= (const iterator &other) |
Protected Member Functions | |
const_iterator (int startPos, const genericVector< T > *vct) |
const iterator type (allows read-only operations).
The use of the iterator classes is similar to the iterators of the STL (Standard Template Library). See lti::genericVector::begin() for an example.
For the debugging version of the iterators, boundary check will be done! This explains the low speed of the iterators of the debug version. In the release version, no boundary check will be done, and the iterators are sometimes a factor 10 faster than the debug iterators.
The use of the access operator at(.) is faster than the iterators in the debug version only. If you need to iterate on a genericVector use iterators instead (in the release version iterators are approx. a factor 3 faster than "at(.)").
CAUTION: Try to use the prefix incremental operator (i.e. ++it) instead of the postfix operator (i.e. it++) to allow efficient code also in debug-modus!
see also iterator
lti::genericVector< T >::const_iterator::const_iterator | ( | ) | [inline] |
default constructor
Referenced by lti::genericVector< T >::const_iterator::operator+(), and lti::genericVector< T >::const_iterator::operator-().
lti::genericVector< T >::const_iterator::const_iterator | ( | const const_iterator & | other | ) | [inline] |
copy constructor
lti::genericVector< T >::const_iterator::const_iterator | ( | const iterator & | other | ) | [inline] |
copy constructor
lti::genericVector< T >::const_iterator::const_iterator | ( | int | startPos, | |
const genericVector< T > * | vct | |||
) | [inline, explicit, protected] |
protected constructor DO NOT EXPLICITLY USE THIS CONSTRUCTOR.
OTHERWISE YOUR CODE WILL NOT COMPILE IN THE RELEASE VERSION!
bool lti::genericVector< T >::const_iterator::operator!= | ( | const iterator & | other | ) | const [inline] |
compare if both pointed positions are different
References lti::genericVector< T >::iterator::getPos().
bool lti::genericVector< T >::const_iterator::operator!= | ( | const const_iterator & | other | ) | const [inline] |
compare if both pointed positions are different
const T& lti::genericVector< T >::const_iterator::operator* | ( | ) | [inline] |
get pointed data
const_iterator lti::genericVector< T >::const_iterator::operator+ | ( | const int | n | ) | [inline] |
advance (skip) some elements.
Use this operator with care! Note that you can skip the end of the genericVector, and read (or even worse: write!) out of bounds!
References lti::genericVector< T >::const_iterator::const_iterator().
const_iterator lti::genericVector< T >::const_iterator::operator++ | ( | int | ) | [inline] |
advance to next item -- postfix
const_iterator& lti::genericVector< T >::const_iterator::operator++ | ( | ) | [inline] |
advance to next item -- prefix
const_iterator& lti::genericVector< T >::const_iterator::operator+= | ( | const int | n | ) | [inline] |
advance (skip) some elements.
Use this operator with care! Note that you can skip the end of the genericVector, and read (or even worse: write!) out of bounds!
const_iterator lti::genericVector< T >::const_iterator::operator- | ( | const int | n | ) | [inline] |
recede (skip) some elements.
Use this operator with care! Note that you can skip the beginning of the genericVector, and read (or even worse: write!) out of bounds!
References lti::genericVector< T >::const_iterator::const_iterator().
const_iterator lti::genericVector< T >::const_iterator::operator-- | ( | int | ) | [inline] |
recede to previous item -- postfix
const_iterator& lti::genericVector< T >::const_iterator::operator-- | ( | ) | [inline] |
recede to previous item -- prefix
const_iterator& lti::genericVector< T >::const_iterator::operator-= | ( | const int | n | ) | [inline] |
recede (skip) some elements.
Use this operator with care! Note that you can skip the beginning of the genericVector, and read (or even worse: write!) out of bounds!
bool lti::genericVector< T >::const_iterator::operator< | ( | const const_iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator< | ( | const iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator<= | ( | const const_iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator<= | ( | const iterator & | other | ) | const [inline] |
const_iterator& lti::genericVector< T >::const_iterator::operator= | ( | const iterator & | other | ) | [inline] |
copy member
References lti::genericVector< T >::iterator::getGenericVector(), and lti::genericVector< T >::iterator::getPos().
const_iterator& lti::genericVector< T >::const_iterator::operator= | ( | const const_iterator & | other | ) | [inline] |
copy member
bool lti::genericVector< T >::const_iterator::operator== | ( | const iterator & | other | ) | const [inline] |
compare if both pointed positions are the same
References lti::genericVector< T >::iterator::getPos().
bool lti::genericVector< T >::const_iterator::operator== | ( | const const_iterator & | other | ) | const [inline] |
compare if both pointed positions are the same
bool lti::genericVector< T >::const_iterator::operator> | ( | const const_iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator> | ( | const iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator>= | ( | const const_iterator & | other | ) | const [inline] |
bool lti::genericVector< T >::const_iterator::operator>= | ( | const iterator & | other | ) | const [inline] |
const T& lti::genericVector< T >::const_iterator::operator[] | ( | const int | i | ) | [inline] |
access the elements relative to the iterator position