cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vctVarStrideNArrayConstIterator< _ownerType, _forward > Class Template Reference

#include <vctForwardDeclarations.h>

Inheritance diagram for vctVarStrideNArrayConstIterator< _ownerType, _forward >:
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::iterator
< std::random_access_iterator_tag,
value_type > 
BaseType
 
typedef BaseType::iterator_category 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_type & operator[] (difference_type index) const
 
const value_type & operator* (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_type * ElementPointer
 

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

template<class _ownerType, bool _forward>
typedef _ownerType::value_type vctVarStrideNArrayConstIterator< _ownerType, _forward >::_elementType
template<class _ownerType, bool _forward>
typedef std::iterator<std::random_access_iterator_tag, value_type> vctVarStrideNArrayConstIterator< _ownerType, _forward >::BaseType

Base type for this iterator, i.e. std::iterator.

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

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

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

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

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

The type of the iterator itself.

Member Enumeration Documentation

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

Define DIRECTION

Enumerator
DIRECTION 

Constructor & Destructor Documentation

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

Default constructor: create an uninitialized object.

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!

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

Copy constructor

Member Function Documentation

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

Complementary operation to operator==.

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

Dereference (const).

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

Pre-increment.

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

Post-increment.

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

Increment by offset.

Parameters
differenceoffset to increment by
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.
template<class _ownerType, bool _forward>
ThisType& vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator-- ( void  )
inline

Pre-decrement.

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

Post-decrement.

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

Decrement by offset.

Parameters
differenceoffset to decrement by
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.
template<class _ownerType, bool _forward>
bool vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator<= ( const ThisType other) const
inline
template<class _ownerType, bool _forward>
ThisType& vctVarStrideNArrayConstIterator< _ownerType, _forward >::operator= ( const ThisType other)
inline

Assignment

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

Equality of iterators, required by STL.

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

Complementary operation to operator <.

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

Random access (return const reference).

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.

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

Member Data Documentation

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.

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.

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: