claraty::N_2D_Array_const_Iterator< T > Class Template Reference
#include <2d_array_iterator.h>
Collaboration diagram for claraty::N_2D_Array_const_Iterator< T >:

Public Types | |
| typedef std::bidirectional_iterator_tag | iterator_category |
| typedef T | value_type |
| typedef ptrdiff_t | difference_type |
| typedef const T * | pointer |
| typedef const T & | reference |
Public Member Functions | |
| N_2D_Array_const_Iterator (const N_2D_Array_Iterator< T > &rhs) | |
| const T & | operator * () const |
| const T * | operator-> () const |
| bool | operator== (const N_2D_Array_const_Iterator< T > &rhs) const |
| bool | operator!= (const N_2D_Array_const_Iterator< T > &rhs) const |
| N_2D_Array_const_Iterator< T > & | operator++ () |
| N_2D_Array_const_Iterator< T > | operator++ (int) |
| N_2D_Array_const_Iterator< T > & | operator-- () |
| N_2D_Array_const_Iterator< T > | operator-- (int) |
Private Member Functions | |
| N_2D_Array_const_Iterator (const T *pt, bool sub=false, int w=0, int s=0) | |
Private Attributes | |
| const T * | ptr |
| int | offset |
| const int | width |
| const int | stride |
| const bool | fromSubarray |
Friends | |
| class | N_2D_Array< T > |
Detailed Description
template<class T>
class claraty::N_2D_Array_const_Iterator< T >
Definition at line 122 of file 2d_array_iterator.h.
Member Typedef Documentation
| typedef std::bidirectional_iterator_tag claraty::N_2D_Array_const_Iterator< T >::iterator_category |
Definition at line 136 of file 2d_array_iterator.h.
| typedef T claraty::N_2D_Array_const_Iterator< T >::value_type |
Definition at line 137 of file 2d_array_iterator.h.
| typedef ptrdiff_t claraty::N_2D_Array_const_Iterator< T >::difference_type |
Definition at line 138 of file 2d_array_iterator.h.
| typedef const T* claraty::N_2D_Array_const_Iterator< T >::pointer |
Definition at line 139 of file 2d_array_iterator.h.
| typedef const T& claraty::N_2D_Array_const_Iterator< T >::reference |
Definition at line 140 of file 2d_array_iterator.h.
Constructor & Destructor Documentation
| claraty::N_2D_Array_const_Iterator< T >::N_2D_Array_const_Iterator | ( | const T * | pt, | |
| bool | sub = false, |
|||
| int | w = 0, |
|||
| int | s = 0 | |||
| ) | [inline, private] |
Definition at line 131 of file 2d_array_iterator.h.
00132 : ptr(pt), offset(0), width(w), stride(s), fromSubarray(sub) { }
| claraty::N_2D_Array_const_Iterator< T >::N_2D_Array_const_Iterator | ( | const N_2D_Array_Iterator< T > & | rhs | ) | [inline] |
Definition at line 145 of file 2d_array_iterator.h.
00146 : ptr(rhs.ptr), offset(rhs.offset), width(rhs.width), stride(rhs.stride), 00147 fromSubarray(rhs.fromSubarray) 00148 { 00149 }
Member Function Documentation
| const T& claraty::N_2D_Array_const_Iterator< T >::operator * | ( | ) | const [inline] |
Definition at line 152 of file 2d_array_iterator.h.
References claraty::N_2D_Array_const_Iterator< T >::ptr.
00152 { return *ptr; }
| const T* claraty::N_2D_Array_const_Iterator< T >::operator-> | ( | ) | const [inline] |
Definition at line 153 of file 2d_array_iterator.h.
References claraty::N_2D_Array_const_Iterator< T >::ptr.
00153 { return ptr; }
| bool claraty::N_2D_Array_const_Iterator< T >::operator== | ( | const N_2D_Array_const_Iterator< T > & | rhs | ) | const [inline] |
Definition at line 155 of file 2d_array_iterator.h.
References claraty::N_2D_Array_const_Iterator< T >::ptr.
00155 { 00156 return ptr == rhs.ptr; 00157 }
| bool claraty::N_2D_Array_const_Iterator< T >::operator!= | ( | const N_2D_Array_const_Iterator< T > & | rhs | ) | const [inline] |
| N_2D_Array_const_Iterator<T>& claraty::N_2D_Array_const_Iterator< T >::operator++ | ( | ) | [inline] |
Definition at line 163 of file 2d_array_iterator.h.
References claraty::N_2D_Array_const_Iterator< T >::fromSubarray, claraty::N_2D_Array_const_Iterator< T >::offset, claraty::N_2D_Array_const_Iterator< T >::ptr, claraty::N_2D_Array_const_Iterator< T >::stride, and claraty::N_2D_Array_const_Iterator< T >::width.
00163 { // prefix 00164 ++ptr; 00165 if (fromSubarray && ++offset == width) { 00166 ptr = ptr - width + stride; 00167 offset = 0; 00168 } 00169 return *this; 00170 }
| N_2D_Array_const_Iterator<T> claraty::N_2D_Array_const_Iterator< T >::operator++ | ( | int | ) | [inline] |
Definition at line 171 of file 2d_array_iterator.h.
00171 { // postfix 00172 N_2D_Array_const_Iterator<T> tmp = *this; 00173 ++*this; 00174 return tmp; 00175 }
| N_2D_Array_const_Iterator<T>& claraty::N_2D_Array_const_Iterator< T >::operator-- | ( | ) | [inline] |
Definition at line 177 of file 2d_array_iterator.h.
References claraty::N_2D_Array_const_Iterator< T >::fromSubarray, claraty::N_2D_Array_const_Iterator< T >::offset, claraty::N_2D_Array_const_Iterator< T >::ptr, claraty::N_2D_Array_const_Iterator< T >::stride, and claraty::N_2D_Array_const_Iterator< T >::width.
00177 { // prefix 00178 --ptr; 00179 if (fromSubarray && --offset == -1) { 00180 ptr = ptr + width - stride; 00181 offset = 0; 00182 } 00183 return *this; 00184 }
| N_2D_Array_const_Iterator<T> claraty::N_2D_Array_const_Iterator< T >::operator-- | ( | int | ) | [inline] |
Definition at line 185 of file 2d_array_iterator.h.
00185 { // postfix 00186 N_2D_Array_const_Iterator<T> tmp = *this; 00187 --*this; 00188 return tmp; 00189 }
Friends And Related Function Documentation
friend class N_2D_Array< T > [friend] |
Definition at line 129 of file 2d_array_iterator.h.
Member Data Documentation
const T* claraty::N_2D_Array_const_Iterator< T >::ptr [private] |
Definition at line 124 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_const_Iterator< T >::operator *(), claraty::N_2D_Array_const_Iterator< T >::operator++(), claraty::N_2D_Array_const_Iterator< T >::operator--(), claraty::N_2D_Array_const_Iterator< T >::operator->(), and claraty::N_2D_Array_const_Iterator< T >::operator==().
int claraty::N_2D_Array_const_Iterator< T >::offset [private] |
Definition at line 125 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_const_Iterator< T >::operator++(), and claraty::N_2D_Array_const_Iterator< T >::operator--().
const int claraty::N_2D_Array_const_Iterator< T >::width [private] |
Definition at line 126 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_const_Iterator< T >::operator++(), and claraty::N_2D_Array_const_Iterator< T >::operator--().
const int claraty::N_2D_Array_const_Iterator< T >::stride [private] |
Definition at line 126 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_const_Iterator< T >::operator++(), and claraty::N_2D_Array_const_Iterator< T >::operator--().
const bool claraty::N_2D_Array_const_Iterator< T >::fromSubarray [private] |
Definition at line 127 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_const_Iterator< T >::operator++(), and claraty::N_2D_Array_const_Iterator< T >::operator--().
The documentation for this class was generated from the following file: