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

Public Types | |
| typedef std::bidirectional_iterator_tag | iterator_category |
| typedef T | value_type |
| typedef ptrdiff_t | difference_type |
| typedef T * | pointer |
| typedef T & | reference |
Public Member Functions | |
| T & | operator * () |
| T * | operator-> () |
| const T & | operator * () const |
| const T * | operator-> () const |
| bool | operator== (const N_2D_Array_Iterator< T > &rhs) const |
| bool | operator!= (const N_2D_Array_Iterator< T > &rhs) const |
| N_2D_Array_Iterator< T > & | operator++ () |
| N_2D_Array_Iterator< T > | operator++ (int) |
| N_2D_Array_Iterator< T > & | operator-- () |
| N_2D_Array_Iterator< T > | operator-- (int) |
Private Member Functions | |
| N_2D_Array_Iterator (T *pt, bool sub=false, int w=0, int s=0) | |
Private Attributes | |
| T * | ptr |
| int | offset |
| const int | width |
| const int | stride |
| const bool | fromSubarray |
Friends | |
| class | N_2D_Array< T > |
| class | N_2D_Array_const_Iterator< T > |
Detailed Description
template<class T>
class claraty::N_2D_Array_Iterator< T >
Definition at line 54 of file 2d_array_iterator.h.
Member Typedef Documentation
| typedef std::bidirectional_iterator_tag claraty::N_2D_Array_Iterator< T >::iterator_category |
Definition at line 69 of file 2d_array_iterator.h.
| typedef T claraty::N_2D_Array_Iterator< T >::value_type |
Definition at line 70 of file 2d_array_iterator.h.
| typedef ptrdiff_t claraty::N_2D_Array_Iterator< T >::difference_type |
Definition at line 71 of file 2d_array_iterator.h.
| typedef T* claraty::N_2D_Array_Iterator< T >::pointer |
Definition at line 72 of file 2d_array_iterator.h.
| typedef T& claraty::N_2D_Array_Iterator< T >::reference |
Definition at line 73 of file 2d_array_iterator.h.
Constructor & Destructor Documentation
| claraty::N_2D_Array_Iterator< T >::N_2D_Array_Iterator | ( | T * | pt, | |
| bool | sub = false, |
|||
| int | w = 0, |
|||
| int | s = 0 | |||
| ) | [inline, private] |
Definition at line 64 of file 2d_array_iterator.h.
00065 : ptr(pt), offset(0), width(w), stride(s), fromSubarray(sub) { }
Member Function Documentation
| T& claraty::N_2D_Array_Iterator< T >::operator * | ( | ) | [inline] |
Definition at line 78 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::ptr.
00078 { return *ptr; }
| T* claraty::N_2D_Array_Iterator< T >::operator-> | ( | ) | [inline] |
Definition at line 79 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::ptr.
00079 { return ptr; }
| const T& claraty::N_2D_Array_Iterator< T >::operator * | ( | ) | const [inline] |
Definition at line 81 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::ptr.
00081 { return *ptr; }
| const T* claraty::N_2D_Array_Iterator< T >::operator-> | ( | ) | const [inline] |
Definition at line 82 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::ptr.
00082 { return ptr; }
| bool claraty::N_2D_Array_Iterator< T >::operator== | ( | const N_2D_Array_Iterator< T > & | rhs | ) | const [inline] |
Definition at line 84 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::ptr.
00084 { 00085 return ptr == rhs.ptr; 00086 }
| bool claraty::N_2D_Array_Iterator< T >::operator!= | ( | const N_2D_Array_Iterator< T > & | rhs | ) | const [inline] |
| N_2D_Array_Iterator<T>& claraty::N_2D_Array_Iterator< T >::operator++ | ( | ) | [inline] |
Definition at line 92 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::fromSubarray, claraty::N_2D_Array_Iterator< T >::offset, claraty::N_2D_Array_Iterator< T >::ptr, claraty::N_2D_Array_Iterator< T >::stride, and claraty::N_2D_Array_Iterator< T >::width.
00092 { // prefix 00093 ++ptr; 00094 if (fromSubarray && ++offset == width) { 00095 ptr = ptr - width + stride; 00096 offset = 0; 00097 } 00098 return *this; 00099 }
| N_2D_Array_Iterator<T> claraty::N_2D_Array_Iterator< T >::operator++ | ( | int | ) | [inline] |
Definition at line 100 of file 2d_array_iterator.h.
00100 { // postfix 00101 N_2D_Array_Iterator<T> tmp = *this; 00102 ++*this; 00103 return tmp; 00104 }
| N_2D_Array_Iterator<T>& claraty::N_2D_Array_Iterator< T >::operator-- | ( | ) | [inline] |
Definition at line 106 of file 2d_array_iterator.h.
References claraty::N_2D_Array_Iterator< T >::fromSubarray, claraty::N_2D_Array_Iterator< T >::offset, claraty::N_2D_Array_Iterator< T >::ptr, claraty::N_2D_Array_Iterator< T >::stride, and claraty::N_2D_Array_Iterator< T >::width.
00106 { // prefix 00107 --ptr; 00108 if (fromSubarray && --offset == -1) { 00109 ptr = ptr + width - stride; 00110 offset = 0; 00111 } 00112 return *this; 00113 }
| N_2D_Array_Iterator<T> claraty::N_2D_Array_Iterator< T >::operator-- | ( | int | ) | [inline] |
Definition at line 114 of file 2d_array_iterator.h.
00114 { // postfix 00115 N_2D_Array_Iterator<T> tmp = *this; 00116 --*this; 00117 return tmp; 00118 }
Friends And Related Function Documentation
friend class N_2D_Array< T > [friend] |
Definition at line 61 of file 2d_array_iterator.h.
friend class N_2D_Array_const_Iterator< T > [friend] |
Definition at line 62 of file 2d_array_iterator.h.
Member Data Documentation
T* claraty::N_2D_Array_Iterator< T >::ptr [private] |
Definition at line 56 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_Iterator< T >::operator *(), claraty::N_2D_Array_Iterator< T >::operator++(), claraty::N_2D_Array_Iterator< T >::operator--(), claraty::N_2D_Array_Iterator< T >::operator->(), and claraty::N_2D_Array_Iterator< T >::operator==().
int claraty::N_2D_Array_Iterator< T >::offset [private] |
Definition at line 57 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_Iterator< T >::operator++(), and claraty::N_2D_Array_Iterator< T >::operator--().
const int claraty::N_2D_Array_Iterator< T >::width [private] |
Definition at line 58 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_Iterator< T >::operator++(), and claraty::N_2D_Array_Iterator< T >::operator--().
const int claraty::N_2D_Array_Iterator< T >::stride [private] |
Definition at line 58 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_Iterator< T >::operator++(), and claraty::N_2D_Array_Iterator< T >::operator--().
const bool claraty::N_2D_Array_Iterator< T >::fromSubarray [private] |
Definition at line 59 of file 2d_array_iterator.h.
Referenced by claraty::N_2D_Array_Iterator< T >::operator++(), and claraty::N_2D_Array_Iterator< T >::operator--().
The documentation for this class was generated from the following file: