#include <vctVarStrideVectorIterator.h>
Inheritance diagram for vctVarStrideVectorConstIterator< _elementType >:


We first define a const iterator, which only allows to read the referenced object. The non-const iterator hass all the functionality of a const_iterator, plus the mutability of the objects. We therefore derive vctVarStrideVectorIterator from vctVarStrideVectorConstIterator (as done with std::list iterators).
In the current version, we do not define operator=, and rely on explicit declarations of objects and the default operator= and copy constructor.
| _elementType | the type of the element that the iterator refers to. |
Definition at line 57 of file vctVarStrideVectorIterator.h.
| typedef vctVarStrideVectorConstIterator<_elementType> vctVarStrideVectorConstIterator< _elementType >::ThisType |
The type of the iterator itself.
Reimplemented in vctVarStrideVectorIterator< _elementType >.
Definition at line 65 of file vctVarStrideVectorIterator.h.
| typedef std::iterator<std::random_access_iterator_tag, _elementType> vctVarStrideVectorConstIterator< _elementType >::BaseType |
Base type for this iterator, i.e. std::iterator.
Reimplemented in vctVarStrideVectorIterator< _elementType >.
Definition at line 68 of file vctVarStrideVectorIterator.h.
| typedef BaseType::iterator_category vctVarStrideVectorConstIterator< _elementType >::iterator_category |
Type (i.e. category) of iterator, i.e. std::random_access_iterator_tag.
Definition at line 72 of file vctVarStrideVectorIterator.h.
| vctVarStrideVectorConstIterator< _elementType >::vctVarStrideVectorConstIterator | ( | ) | [inline] |
Default constructor: create an uninitialized object.
Definition at line 90 of file vctVarStrideVectorIterator.h.
| vctVarStrideVectorConstIterator< _elementType >::vctVarStrideVectorConstIterator | ( | value_type * | dataPtr, | |
| difference_type | stride = 1 | |||
| ) | [inline, explicit] |
Constructor taking a non-const element pointer. Note that only read operations will be performed!
Definition at line 98 of file vctVarStrideVectorIterator.h.
| vctVarStrideVectorConstIterator< _elementType >::vctVarStrideVectorConstIterator | ( | const value_type * | dataPtr, | |
| difference_type | stride = 1 | |||
| ) | [inline, explicit] |
Constructor taking a const element pointer. We need it in order to deal with const containers being refered by this iterator. We have to perform const_cast to convert back to the stored non-const member pointer of this iterator. However, the non-const iterator class completely shadows the constructors of the const-iterator base class, and so we don't have to worry about creating a non-const iterator over a const container.
Definition at line 111 of file vctVarStrideVectorIterator.h.
| ThisType& vctVarStrideVectorConstIterator< _elementType >::operator++ | ( | void | ) | [inline] |
Pre-increment.
Definition at line 117 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| ThisType vctVarStrideVectorConstIterator< _elementType >::operator++ | ( | int | ) | [inline] |
Post increment.
Definition at line 124 of file vctVarStrideVectorIterator.h.
| ThisType& vctVarStrideVectorConstIterator< _elementType >::operator-- | ( | void | ) | [inline] |
Pre-decrement.
Definition at line 132 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| ThisType vctVarStrideVectorConstIterator< _elementType >::operator-- | ( | int | ) | [inline] |
Post decrement.
Definition at line 139 of file vctVarStrideVectorIterator.h.
| ThisType& vctVarStrideVectorConstIterator< _elementType >::operator+= | ( | difference_type | difference | ) | [inline] |
Increase by given difference.
Definition at line 147 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| ThisType& vctVarStrideVectorConstIterator< _elementType >::operator-= | ( | difference_type | difference | ) | [inline] |
Decrease by given difference.
Definition at line 154 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| difference_type vctVarStrideVectorConstIterator< _elementType >::operator- | ( | const ThisType & | other | ) | const [inline] |
Find difference between iterators. This method does not test for reachability, and may return invalid values if the two iterators are not reachable. It is the user's responsibility to ensure the correctness.
Definition at line 165 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| const value_type& vctVarStrideVectorConstIterator< _elementType >::operator[] | ( | difference_type | index | ) | const [inline] |
Random access (return const reference).
Definition at line 171 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr, and vctVarStrideVectorConstIterator< _elementType >::Stride.
| const value_type& vctVarStrideVectorConstIterator< _elementType >::operator * | ( | void | ) | const [inline] |
Dereference (const)
Definition at line 177 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr.
| bool vctVarStrideVectorConstIterator< _elementType >::operator< | ( | const ThisType & | other | ) | const [inline] |
Order relation between iterators, required by STL.
Definition at line 187 of file vctVarStrideVectorIterator.h.
| bool vctVarStrideVectorConstIterator< _elementType >::operator== | ( | const ThisType & | other | ) | const [inline] |
Equality of iterators, required by STL
Definition at line 193 of file vctVarStrideVectorIterator.h.
References vctVarStrideVectorConstIterator< _elementType >::DataPtr.
| bool vctVarStrideVectorConstIterator< _elementType >::operator> | ( | const ThisType & | other | ) | const [inline] |
Complementary operation to operator <
Definition at line 199 of file vctVarStrideVectorIterator.h.
| bool vctVarStrideVectorConstIterator< _elementType >::operator!= | ( | const ThisType & | other | ) | const [inline] |
Complementary operation to operator ==
Definition at line 205 of file vctVarStrideVectorIterator.h.
value_type* vctVarStrideVectorConstIterator< _elementType >::DataPtr [protected] |
The data member points to the object being refered by this iterator. It is not declared const, so we will be able to use it in the non-const iterator class. But all the methods in vctVarStrideVectorConstIterator are declared const to protect the data from writing.
Definition at line 81 of file vctVarStrideVectorIterator.h.
Referenced by vctVarStrideVectorConstIterator< _elementType >::operator *(), vctVarStrideVectorIterator< _elementType >::operator *(), vctVarStrideVectorIterator< _elementType >::operator++(), vctVarStrideVectorConstIterator< _elementType >::operator++(), vctVarStrideVectorIterator< _elementType >::operator+=(), vctVarStrideVectorConstIterator< _elementType >::operator+=(), vctVarStrideVectorConstIterator< _elementType >::operator-(), vctVarStrideVectorIterator< _elementType >::operator--(), vctVarStrideVectorConstIterator< _elementType >::operator--(), vctVarStrideVectorConstIterator< _elementType >::operator-=(), vctVarStrideVectorIterator< _elementType >::operator-=(), vctVarStrideVectorConstIterator< _elementType >::operator==(), vctVarStrideVectorConstIterator< _elementType >::operator[](), and vctVarStrideVectorIterator< _elementType >::operator[]().