SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWMathVecIterator< T > Class Template Reference

The random access iterator for the RWMathVec collection class. More...

#include <rw/math/mathvec.h>

Inheritance diagram for RWMathVecIterator< T >:
RWMathVecIteratorBase< T >

Public Member Functions

 RWMathVecIterator ()
 
 RWMathVecIterator (const RWMathVecIterator< T > &x)
 
value_type & operator* () const
 
RWMathVecIterator< T > & operator++ ()
 
RWMathVecIterator< T > operator++ (int)
 
RWMathVecIterator< T > & operator+= (difference_type d)
 
difference_type operator- (const RWMathVecIteratorBase< T > &i) const
 
RWMathVecIterator< T > operator- (difference_type d) const
 
RWMathVecIterator< T > & operator-- ()
 
RWMathVecIterator< T > operator-- (int)
 
pointer operator-> () const
 
RWMathVecIteratoroperator= (const RWMathVecIterator< T > &x)
 
value_type & operator[] (difference_type n) const
 
- Public Member Functions inherited from RWMathVecIteratorBase< T >
bool operator!= (const RWMathVecIteratorBase< T > &x) const
 
bool operator< (const RWMathVecIteratorBase< T > &x) const
 
bool operator<= (const RWMathVecIteratorBase< T > &x) const
 
bool operator== (const RWMathVecIteratorBase< T > &x) const
 
bool operator> (const RWMathVecIteratorBase< T > &x) const
 
bool operator>= (const RWMathVecIteratorBase< T > &x) const
 

Detailed Description

template<class T>
class RWMathVecIterator< T >

Class RWMathVecIterator is the random access iterator for the RWMathVec collection class. The RWMathVecIterator class behaves like a pointer to type T and is used to increment through elements of an RWMathVec.

Note
This class should be accessed through RWMathVec::iterator.
Example
#include <rw/math/mathvec.h>
int main()
{
// Assign a unique int value to each element of V
for (int j=0; i != stop; ++i, ++j) *i = j;
}

Constructor & Destructor Documentation

template<class T >
RWMathVecIterator< T >::RWMathVecIterator ( )
inline

Constructs an RWMathVecIterator that is in an uninitialized state. The iterator must be initialized before it is dereferenced.

template<class T >
RWMathVecIterator< T >::RWMathVecIterator ( const RWMathVecIterator< T > &  x)
inline

Constructs an RWMathVecIterator from another RWMathVecIterator. Initialized iterators can be obtained via the RWMathVec::begin() and RWMathVec::end() member functions.

Member Function Documentation

template<class T >
value_type& RWMathVecIterator< T >::operator* ( ) const
inline

Returns a reference to the element pointed to by self.

template<class T >
RWMathVecIterator<T>& RWMathVecIterator< T >::operator++ ( )
inline

Prefix or postfix increment or decrement operator. The RWMathVecIterator points to the next or previous element in the RWMathVec. No error condition is set if the RWMathVecIterator goes past the bounds of the vector. Compare to RWMathVec::begin() and RWMathVec::end() to check that the iterator position is valid.

template<class T >
RWMathVecIterator<T> RWMathVecIterator< T >::operator++ ( int  )
inline

Prefix or postfix increment or decrement operator. The RWMathVecIterator points to the next or previous element in the RWMathVec. No error condition is set if the RWMathVecIterator goes past the bounds of the vector. Compare to RWMathVec::begin() and RWMathVec::end() to check that the iterator position is valid.

template<class T >
RWMathVecIterator<T>& RWMathVecIterator< T >::operator+= ( difference_type  d)
inline

Moves the iterator forward or backward d elements in the RWMathVec. No error condition is set if the iterator goes past the bounds of the vector. Incrementing by d and then decrementing by d returns the iterator to its original position, even if doing so takes it past the bounds of the vector.

template<class T >
difference_type RWMathVecIterator< T >::operator- ( const RWMathVecIteratorBase< T > &  i) const
inline

If the return value is positive, moves the iterator that many elements past the iterator i. If the return value is negative, moves the iterator that many elements before the iterator i.

template<class T >
RWMathVecIterator<T> RWMathVecIterator< T >::operator- ( difference_type  d) const
inline

Returns an iterator that is d elements past (or before) self.

template<class T >
RWMathVecIterator<T>& RWMathVecIterator< T >::operator-- ( )
inline

Prefix or postfix increment or decrement operator. The RWMathVecIterator points to the next or previous element in the RWMathVec. No error condition is set if the RWMathVecIterator goes past the bounds of the vector. Compare to RWMathVec::begin() and RWMathVec::end() to check that the iterator position is valid.

template<class T >
RWMathVecIterator<T> RWMathVecIterator< T >::operator-- ( int  )
inline

Prefix or postfix increment or decrement operator. The RWMathVecIterator points to the next or previous element in the RWMathVec. No error condition is set if the RWMathVecIterator goes past the bounds of the vector. Compare to RWMathVec::begin() and RWMathVec::end() to check that the iterator position is valid.

template<class T >
pointer RWMathVecIterator< T >::operator-> ( ) const
inline

For iterator a, and identifier m, a->m is equivalent to (*a).m.

template<class T >
RWMathVecIterator& RWMathVecIterator< T >::operator= ( const RWMathVecIterator< T > &  x)
inline

Replaces the current iterator position with x. Initialized iterators can be obtained via the RWMathVec::begin() and RWMathVec::end() member functions.

template<class T >
value_type& RWMathVecIterator< T >::operator[] ( difference_type  n) const
inline

Returns a reference to the element n elements after self if n is positive, or n elements before self if n is negative.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.