cisst-saw
Loading...
Searching...
No Matches
vctVarStrideNArrayConstIterator< _ownerType, _forward > Class Template Reference

#include <vctVarStrideNArrayIterator.h>

Inheritance diagram for vctVarStrideNArrayConstIterator< _ownerType, _forward >:
vctVarStrideNArrayIterator< ThisType, true > vctVarStrideNArrayIterator< ThisType, false > vctVarStrideNArrayIterator< _ownerType, _forward >

Public Types

enum  { DIMENSION = _ownerType::DIMENSION }
enum  { DIRECTION = _forward ? +1 : -1 }
typedef _ownerType::value_type _elementType
typedef vctVarStrideNArrayConstIterator< _ownerType, _forward > ThisType
typedef _ownerType OwnerType
typedef std::random_access_iterator_tag iterator_category

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION)
 vctVarStrideNArrayConstIterator (void)
 vctVarStrideNArrayConstIterator (const OwnerType *container, difference_type index=0)
 vctVarStrideNArrayConstIterator (const ThisType &other)
ThisTypeoperator= (const ThisType &other)
ThisTypeoperator++ (void)
ThisType operator++ (int)
ThisTypeoperator-- (void)
ThisType operator-- (int)
ThisTypeoperator+= (difference_type difference)
ThisTypeoperator-= (difference_type difference)
difference_type operator- (const ThisType &other) const
const value_typeoperator[] (difference_type index) const
const value_typeoperator* (void) const
bool operator== (const ThisType &other) const
bool operator!= (const ThisType &other) const
bool operator< (const ThisType &other) const
bool operator<= (const ThisType &other) const
bool operator> (const ThisType &other) const
bool operator>= (const ThisType &other) const

Protected Member Functions

void UpdateElementPointer (void)

Protected Attributes

const OwnerTypeContainerOwner
difference_type MetaIndex
value_typeElementPointer

Detailed Description

template<class _ownerType, bool _forward>
class vctVarStrideNArrayConstIterator< _ownerType, _forward >
Parameters
_ownerTypethe type of the owner of the container to which this iterator points
_forwardset to true for forward iterators, false for reverse iterators
See also
vctVarStrideNArrayIterator

Member Typedef Documentation

◆ _elementType

template<class _ownerType, bool _forward>
typedef _ownerType::value_type vctVarStrideNArrayConstIterator< _ownerType, _forward >::_elementType

◆ iterator_category

template<class _ownerType, bool _forward>
typedef std::random_access_iterator_tag vctVarStrideNArrayConstIterator< _ownerType, _forward >::iterator_category

Type (i.e. category) of iterator, i.e. std::random_access_iterator_tag.

◆ OwnerType

template<class _ownerType, bool _forward>
typedef _ownerType vctVarStrideNArrayConstIterator< _ownerType, _forward >::OwnerType

The type of the owner of the container to which this iterator points.

◆ ThisType

template<class _ownerType, bool _forward>
typedef vctVarStrideNArrayConstIterator<_ownerType, _forward> vctVarStrideNArrayConstIterator< _ownerType, _forward >::ThisType

The type of the iterator itself.

Member Enumeration Documentation

◆ anonymous enum

template<class _ownerType, bool _forward>
anonymous enum
Enumerator
DIMENSION 

◆ anonymous enum

template<class _ownerType, bool _forward>
anonymous enum

Define DIRECTION

Enumerator
DIRECTION 

Constructor & Destructor Documentation

◆ vctVarStrideNArrayConstIterator() [1/3]

template<class _ownerType, bool _forward>
vctVarStrideNArrayConstIterator< _ownerType, _forward >::vctVarStrideNArrayConstIterator ( void )
inline

Default constructor: create an uninitialized object.

◆ vctVarStrideNArrayConstIterator() [2/3]

template<class _ownerType, bool _forward>
vctVarStrideNArrayConstIterator< _ownerType, _forward >::vctVarStrideNArrayConstIterator ( const OwnerType * container,
difference_type index = 0 )
inline

Constructor taking a non const element pointer; the starting position will be the first element of the nArray. Note that only read operations will be performed!

◆ vctVarStrideNArrayConstIterator() [3/3]

template<class _ownerType, bool _forward>
vctVarStrideNArrayConstIterator< _ownerType, _forward >::vctVarStrideNArrayConstIterator ( const ThisType & other)
inline

Copy constructor

Member Function Documentation

◆ operator!=()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator!= ( const ThisType & other) const
inline

Complementary operation to operator==.

◆ operator*()

template<class _ownerType, bool _forward>
const value_type & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator* ( void ) const
inline

Dereference (const).

◆ operator++() [1/2]

template<class _ownerType, bool _forward>
ThisType vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator++ ( int )
inline

Post-increment.

◆ operator++() [2/2]

template<class _ownerType, bool _forward>
ThisType & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator++ ( void )
inline

Pre-increment.

◆ operator+=()

template<class _ownerType, bool _forward>
ThisType & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator+= ( difference_type difference)
inline

Increment by offset.

Parameters
differenceoffset to increment by

◆ operator-()

template<class _ownerType, bool _forward>
difference_type vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator- ( const ThisType & other) const
inline

Subtraction between iterators returns the number of increments needed for the second operand to reach the first operand, if it is reachable.

Note
this operation assumes reachability and does not test for it.

◆ operator--() [1/2]

template<class _ownerType, bool _forward>
ThisType vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator-- ( int )
inline

Post-decrement.

◆ operator--() [2/2]

template<class _ownerType, bool _forward>
ThisType & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator-- ( void )
inline

Pre-decrement.

◆ operator-=()

template<class _ownerType, bool _forward>
ThisType & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator-= ( difference_type difference)
inline

Decrement by offset.

Parameters
differenceoffset to decrement by

◆ operator<()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator< ( const ThisType & other) const
inline

Order relation between iterators, required by STL.

Note
The STL manual states that "if j is reachable from i then i<j". This does not imply the converse: "if i<j then j is reachable from i". In the case here, the converse does not hold.

◆ operator<=()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator<= ( const ThisType & other) const
inline

◆ operator=()

template<class _ownerType, bool _forward>
ThisType & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator= ( const ThisType & other)
inline

Assignment

◆ operator==()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator== ( const ThisType & other) const
inline

Equality of iterators, required by STL.

◆ operator>()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator> ( const ThisType & other) const
inline

Complementary operation to operator <.

◆ operator>=()

template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator>= ( const ThisType & other) const
inline

◆ operator[]()

template<class _ownerType, bool _forward>
const value_type & vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator[] ( difference_type index) const
inline

Random access (return const reference).

◆ UpdateElementPointer()

template<class _ownerType, bool _forward>
void vctVarStrideNArrayConstIterator< _ownerType, _forward >::UpdateElementPointer ( void )
inlineprotected

Auxiliary method to calculate the correct ElementPointer corresponding to the current MetaIndex. See the complete documentation for a detailed description of this algorithm.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

template<class _ownerType, bool _forward>
vctVarStrideNArrayConstIterator< _ownerType, _forward >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType )

◆ VCT_NARRAY_TRAITS_TYPEDEFS()

template<class _ownerType, bool _forward>
vctVarStrideNArrayConstIterator< _ownerType, _forward >::VCT_NARRAY_TRAITS_TYPEDEFS ( DIMENSION )

Member Data Documentation

◆ ContainerOwner

template<class _ownerType, bool _forward>
const OwnerType* vctVarStrideNArrayConstIterator< _ownerType, _forward >::ContainerOwner
protected

Pointer to the address of the container being referred to by this iterator.

◆ ElementPointer

template<class _ownerType, bool _forward>
value_type* vctVarStrideNArrayConstIterator< _ownerType, _forward >::ElementPointer
protected

Pointer to the object being referred to 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 vctVarStrideNArrayConstIterator are declared const to protect the data from writing.

◆ MetaIndex

template<class _ownerType, bool _forward>
difference_type vctVarStrideNArrayConstIterator< _ownerType, _forward >::MetaIndex
protected

Pseudo-index for the iterator. See complete documentation for a thorough discussion of this "meta index".


The documentation for this class was generated from the following files: