|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiGenericVector.h>
Public Member Functions | |
| iterator () | |
| iterator (const iterator &other) | |
| iterator & | operator++ () |
| iterator | operator++ (int) |
| iterator & | operator-- () |
| iterator | operator-- (int) |
| iterator & | operator+= (const int n) |
| iterator & | operator-= (const int n) |
| iterator | operator+ (const int n) |
| iterator | operator- (const int n) |
| 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 |
| T & | operator * () |
| T & | operator[] (const int i) |
| iterator & | operator= (const iterator &other) |
Protected Member Functions | |
| iterator (const int startPos, genericVector< T > *vct) | |
| const int & | getPos () const |
| const genericVector< T > * | getGenericVector () const |
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 const_iterator
|
|||||||||
|
Default constructor.
|
|
||||||||||
|
copy constructor
|
|
||||||||||||||||
|
protected constructor (for internal use only) NEVER USE EXPLICITLY THIS CONSTRUCTOR, OR YOUR CODE WILL NOT COMPILE IN THE RELEASE VERSION!
|
|
|||||||||
|
for internal use only!!! This method does not exist in the release version!
|
|
|||||||||
|
for internal use only!!! This method does not exist in the release version!
|
|
|||||||||
|
get pointed data
|
|
||||||||||
|
compare if both pointed positions are different
|
|
||||||||||
|
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! |
|
||||||||||
|
advance to next item
|
|
|||||||||
|
advance to next item
|
|
||||||||||
|
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! |
|
||||||||||
|
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! |
|
||||||||||
|
recede to previous item
|
|
|||||||||
|
recede to previous item
|
|
||||||||||
|
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! |
|
||||||||||
|
compare if the position of the first iterator is smaller than the position of the second iterator
|
|
||||||||||
|
compare if the position of the first iterator is smaller or equal than the position of the second iterator
|
|
||||||||||
|
copy member
|
|
||||||||||
|
compare if both pointed positions are the same
|
|
||||||||||
|
compare if the position of the first iterator is greater than the position of the second iterator
|
|
||||||||||
|
compare if the position of the first iterator is greater or equal than the position of the second iterator
|
|
||||||||||
|
access the elements relative to the iterator position
|