SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
The random access iterator for the RWGenMat<T> collection class. More...
#include <rw/math/genmat.h>
Public Types | |
typedef RWGenMat< T > ::difference_type | difference_type |
typedef RWGenMat< T >::value_type | value_type |
typedef RWGenMat< T > ::const_pointer | const_pointer |
Public Member Functions | |
RWGenMatConstIterator () | |
RWGenMatConstIterator (const RWGenMatIteratorBase< T > &x) | |
RWGenMatConstIterator< T > & | operator++ () |
RWGenMatConstIterator< T > & | operator-- () |
RWGenMatConstIterator< T > | operator++ (int) |
RWGenMatConstIterator< T > | operator-- (int) |
RWGenMatConstIterator< T > & | operator+= (difference_type d) |
RWGenMatConstIterator< T > & | operator-= (difference_type d) |
difference_type | operator- (const RWGenMatIteratorBase< T > &x) const |
RWGenMatConstIterator< T > | operator- (difference_type n) const |
RWGenMatConstIterator< T > | operator+ (difference_type n) const |
const value_type & | operator[] (difference_type n) const |
const value_type & | operator* () const |
const_pointer | operator-> () |
Class RWGenMatConstIterator is the random access iterator for the RWGenMat<T> collection class. The RWGenMatConstIterator class behaves like a pointer to type T and is used to increment through elements of an RWGenMat<T> . The RWGenMatConstIterator differs from a plain RWGenMatIterator in that the value of a dereferenced RWGenMatConstIterator may not be changed.
#include <iostream> #include <rw/math/genmat.h> int main() { RWGenMat<int> V(5,1); // Create a length 5 matrix // with all 1's RWGenMat<int>::const_iterator i = V.begin(); RWGenMat<int>::const_iterator stop = V.end(); // print each element of V while(i != stop) { std::cout << *i << std::endl; ++i; } }
typedef RWGenMat<T>::const_pointer RWGenMatConstIterator< T >::const_pointer |
Typedef for a const pointer to a value in this container.
Reimplemented from RWGenMatIteratorBase< T >.
typedef RWGenMat<T>::difference_type RWGenMatConstIterator< T >::difference_type |
Typedef for the type of result from subtracting two iterators obtained from this container.
Reimplemented from RWGenMatIteratorBase< T >.
typedef RWGenMat<T>::value_type RWGenMatConstIterator< T >::value_type |
Typedef for the type of elements in this container.
Reimplemented from RWGenMatIteratorBase< T >.
RWGenMatConstIterator< T >::RWGenMatConstIterator | ( | ) | [inline] |
Constructs an iterator that is in an uninitialized state. The iterator must be initialized before it is dereferenced.
RWGenMatConstIterator< T >::RWGenMatConstIterator | ( | const RWGenMatIteratorBase< T > & | x | ) | [inline] |
Constructs a RWGenMatConstIterator from another RWGenMatIterator or RWGenMatConstIterator. Initialized RWGenMatIterator and RWGenMatConstIterator instances can be obtained via the RWGenMat<T>::begin() and RWGenMat<T>::end() member functions of RWGenMat<T> .
const value_type& RWGenMatConstIterator< T >::operator* | ( | ) | const [inline] |
Returns a reference to the element pointed to by self.
RWGenMatConstIterator<T> RWGenMatConstIterator< T >::operator+ | ( | difference_type | n | ) | const [inline] |
Returns a RWGenMatConstIterator that is n elements past (or before) self.
RWGenMatConstIterator<T> RWGenMatConstIterator< T >::operator++ | ( | int | ) | [inline] |
Postfix increment operator. The RWGenMatConstIterator points to the next element in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Compare to RWGenMat<T>::begin() and RWGenMat<T>::end() to check that the RWGenMatConstIterator position is valid.
RWGenMatConstIterator<T>& RWGenMatConstIterator< T >::operator++ | ( | ) | [inline] |
Prefix increment operator. The RWGenMatConstIterator points to the next element in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Compare to RWGenMat<T>::begin() and RWGenMat<T>::end() to check that the RWGenMatConstIterator position is valid.
RWGenMatConstIterator<T>& RWGenMatConstIterator< T >::operator+= | ( | difference_type | d | ) | [inline] |
The RWGenMatConstIterator is moved forward d elements in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Incrementing by d and then decrementing by d returns the RWGenMatConstIterator to its original position, even if doing so takes it past the bounds of the matrix.
RWGenMatConstIterator<T> RWGenMatConstIterator< T >::operator- | ( | difference_type | n | ) | const [inline] |
Returns a RWGenMatConstIterator that is n elements past (or before) self.
difference_type RWGenMatConstIterator< T >::operator- | ( | const RWGenMatIteratorBase< T > & | x | ) | const [inline] |
If the return value is positive, the RWGenMatConstIterator is that many elements past the RWGenMatConstIterator x. If the return value is negative, the RWGenMatConstIterator is that many elements before the RWGenMatConstIterator x.
RWGenMatConstIterator<T> RWGenMatConstIterator< T >::operator-- | ( | int | ) | [inline] |
Postfix decrement operator. The RWGenMatConstIterator points to the previous element in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Compare to RWGenMat<T>::begin() and RWGenMat<T>::end() to check that the RWGenMatConstIterator position is valid.
RWGenMatConstIterator<T>& RWGenMatConstIterator< T >::operator-- | ( | ) | [inline] |
Prefix decrement operator. The RWGenMatConstIterator points to the previous element in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Compare to RWGenMat<T>::begin() and RWGenMat<T>::end() to check that the RWGenMatConstIterator position is valid.
RWGenMatConstIterator<T>& RWGenMatConstIterator< T >::operator-= | ( | difference_type | d | ) | [inline] |
The RWGenMatConstIterator is moved backward d elements in the RWGenMat<T> . No error condition is set if the RWGenMatConstIterator goes past the bounds of the matrix. Incrementing by d and then decrementing by d returns the RWGenMatConstIterator to its original position, even if doing so takes it past the bounds of the matrix.
const_pointer RWGenMatConstIterator< T >::operator-> | ( | ) | [inline] |
For iterator a, and identifier m, a->m is equivalent to (*a).m.
const value_type& RWGenMatConstIterator< T >::operator[] | ( | difference_type | n | ) | const [inline] |
Returns a reference to the element n elements after self if n is positive, or before self if n is negative.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.