|
cisst-saw
|
#include <vctVarStrideMatrixIterator.h>
Public Types | |
| typedef vctVarStrideMatrixConstIterator< _elementType > | ThisType |
| typedef std::random_access_iterator_tag | iterator_category |
Public Member Functions | |
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) | |
| vctVarStrideMatrixConstIterator () | |
| vctVarStrideMatrixConstIterator (value_type *dataPtr, stride_type columnStride, size_type numColumns, stride_type rowStride, size_type initialColumn=0) | |
| vctVarStrideMatrixConstIterator (const value_type *dataPtr, difference_type columnStride, size_type numColumns, stride_type rowStride, size_type initialColumn=0) | |
| ThisType & | operator++ () |
| ThisType | operator++ (int) |
| ThisType & | operator-- () |
| ThisType | operator-- (int) |
| ThisType & | operator+= (difference_type difference) |
| ThisType & | operator-= (difference_type difference) |
| difference_type | operator- (const ThisType &other) const |
| const value_type & | operator[] (difference_type index) const |
| const value_type & | operator* () 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 | WrapToRight () |
| void | WrapToLeft () |
Protected Attributes | |
| value_type * | DataPtr |
| stride_type | ColumnStride |
| difference_type | NumColumns |
| stride_type | RowStride |
| difference_type | CurrentColumn |
| _elementType | the type of the element that the iterator refers to. |
| typedef std::random_access_iterator_tag vctVarStrideMatrixConstIterator< _elementType >::iterator_category |
Type (i.e. category) of iterator, i.e. std::random_access_iterator_tag.
| typedef vctVarStrideMatrixConstIterator<_elementType> vctVarStrideMatrixConstIterator< _elementType >::ThisType |
The type of the iterator itself.
|
inline |
Default constructor: create an uninitialized object.
|
inline |
Constructor taking a non-const element pointer. Note that only read operations will be performed!
|
inline |
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.
|
inline |
Complementary operation to operator ==.
|
inline |
Dereference (const).
|
inline |
Pre-increment.
|
inline |
Post-increment.
|
inline |
Increment by offset.
| difference | offset to increment by |
|
inline |
Subtraction between iterators returns the number of increments needed for the second operand to reach the first operand, if it is reachable.
The number of increments is found by the following equations: DataPtr - (difference / NumColumns) * RowStride + (difference % NumColumns) * ColumnStride == other.DataPtr DataPtr - other.DataPtr == (difference / NumColumns) * RowStride + (difference % NumColumns) * ColumnStride
if (RowStride >= NumColumns * ColumnStride) { (DataPtr - other.DataPtr) / RowStride == row_diff == (difference / NumColumns) DataPtr - other.DataPtr - row_diff * RowStride == (difference % NumColumns) * ColumnStride (DataPtr - other.DataPtr - row_diff * RowStride) / ColumnStride == col_diff == (difference % NumColumns) difference == row_diff * NumColumns + col_diff } otherwise switch the roles of rows and columns.
|
inline |
Pre-decrement.
|
inline |
Post-decrement.
|
inline |
Decrement by offset.
| difference | offset to decrement by |
|
inline |
Order relation between iterators, required by STL.
|
inline |
|
inline |
Equality of iterators, required by STL.
|
inline |
Complementary operation to operator <.
|
inline |
|
inline |
Random access (return const reference).
| vctVarStrideMatrixConstIterator< _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | _elementType | ) |
|
inlineprotected |
An auxiliary method to wrap the column index of the iterator. If the current column is negative, move one row up, and wrap to the corresponding column starting from the right
|
inlineprotected |
An auxiliary method to wrap the column index of the iterator. If the current column exceeds the number of columns in the matrix, more one row down and wrap to the corresponding column starting from the left
|
protected |
|
protected |
|
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 vctVarStrideMatrixConstIterator are declared const to protect the data from writing.
|
protected |
|
protected |