NL3D::CAdvance1616Iterator< T, PT > Struct Template Reference

#include <ps_iterator.h>


Detailed Description

template<typename T, typename PT>
struct NL3D::CAdvance1616Iterator< T, PT >

Class that manage iterator progression with a step of 16:16 in fixed point We assume that T::value_type gives the operator* return type T is the type of the iterator This iterator is READ-ONLY NOTE: this iterator is not intended to serves with STL algo, it doesn't support all the needed features, ++ and * operator are provided as syntaxic sugars..

Definition at line 90 of file ps_iterator.h.

Public Member Functions

void advance (uint numSteps)
void advance ()
 CAdvance1616Iterator (T it, uint32 index, uint32 step)
 create this iterator from the start of a container, and a given position (expressed in fixed point)

 CAdvance1616Iterator ()
const PT & get () const
const PT & operator * () const
bool operator!= (const CAdvance1616Iterator &other) const
CAdvance1616Iterator operator+ (sint quantity)
CAdvance1616Iterator operator++ (int)
CAdvance1616Iteratoroperator++ ()
 T operator -> () const { return It + (CurrPos >> 16); }.

CAdvance1616Iteratoroperator+= (sint quantity)
bool operator== (const CAdvance1616Iterator &other) const

Data Fields

uint32 CurrPos
It
uint32 Step


Constructor & Destructor Documentation

template<typename T, typename PT>
NL3D::CAdvance1616Iterator< T, PT >::CAdvance1616Iterator  )  [inline]
 

Definition at line 95 of file ps_iterator.h.

00095 {}

template<typename T, typename PT>
NL3D::CAdvance1616Iterator< T, PT >::CAdvance1616Iterator it,
uint32  index,
uint32  step
[inline]
 

create this iterator from the start of a container, and a given position (expressed in fixed point)

Definition at line 97 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos, index, and uint32.

00098                 {
00099                         It = it;
00100                         CurrPos = index * step;
00101                         Step = step;
00102                 }


Member Function Documentation

template<typename T, typename PT>
void NL3D::CAdvance1616Iterator< T, PT >::advance uint  numSteps  )  [inline]
 

Definition at line 106 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos, and uint.

00107                 { 
00108                         CurrPos = CurrPos + numSteps * Step; 
00109                 }       

template<typename T, typename PT>
void NL3D::CAdvance1616Iterator< T, PT >::advance  )  [inline]
 

Definition at line 105 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos.

Referenced by NL3D::CAdvance1616Iterator< T, PT >::operator++().

00105 { CurrPos += Step; }

template<typename T, typename PT>
const PT& NL3D::CAdvance1616Iterator< T, PT >::get  )  const [inline]
 

Definition at line 104 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos.

Referenced by NL3D::CAdvance1616Iterator< T, PT >::operator *().

00104 { return *(It + (CurrPos >> 16)); }

template<typename T, typename PT>
const PT& NL3D::CAdvance1616Iterator< T, PT >::operator *  )  const [inline]
 

Definition at line 110 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::get().

00110 { return get(); }

template<typename T, typename PT>
bool NL3D::CAdvance1616Iterator< T, PT >::operator!= const CAdvance1616Iterator< T, PT > &  other  )  const [inline]
 

Definition at line 122 of file ps_iterator.h.

00122 { return !(*this == other); }

template<typename T, typename PT>
CAdvance1616Iterator NL3D::CAdvance1616Iterator< T, PT >::operator+ sint  quantity  )  [inline]
 

Definition at line 123 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos, res, and sint.

00124                 { 
00125                         CAdvance1616Iterator res; 
00126                         res.It = It;
00127                         res.CurrPos = CurrPos + Step * quantity;
00128                         res.Step = Step;
00129                         return res;
00130                 }

template<typename T, typename PT>
CAdvance1616Iterator NL3D::CAdvance1616Iterator< T, PT >::operator++ int   )  [inline]
 

Definition at line 113 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::advance().

00113 { CAdvance1616Iterator tmp = this; advance(); return tmp; }             

template<typename T, typename PT>
CAdvance1616Iterator& NL3D::CAdvance1616Iterator< T, PT >::operator++  )  [inline]
 

T operator -> () const { return It + (CurrPos >> 16); }.

Definition at line 112 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::advance().

00112 { advance(); return *this; }

template<typename T, typename PT>
CAdvance1616Iterator& NL3D::CAdvance1616Iterator< T, PT >::operator+= sint  quantity  )  [inline]
 

Definition at line 131 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos, and sint.

00132                 {
00133                         CurrPos += quantity * Step;
00134                         return *this;
00135                 }

template<typename T, typename PT>
bool NL3D::CAdvance1616Iterator< T, PT >::operator== const CAdvance1616Iterator< T, PT > &  other  )  const [inline]
 

Definition at line 114 of file ps_iterator.h.

References NL3D::CAdvance1616Iterator< T, PT >::CurrPos, NL3D::CAdvance1616Iterator< T, PT >::It, nlassert, and NL3D::CAdvance1616Iterator< T, PT >::Step.

00115                 { 
00116                         #ifdef _DEBUG
00117                                 nlassert(other.It == It);
00118                                 nlassert(other.Step == Step);
00119                         #endif                  
00120                         return other.CurrPos == CurrPos; 
00121                 }


Field Documentation

template<typename T, typename PT>
uint32 NL3D::CAdvance1616Iterator< T, PT >::CurrPos
 

Definition at line 93 of file ps_iterator.h.

Referenced by NL3D::CAdvance1616Iterator< T, PT >::advance(), NL3D::CAdvance1616Iterator< T, PT >::CAdvance1616Iterator(), NL3D::CAdvance1616Iterator< T, PT >::get(), NL3D::CAdvance1616Iterator< T, PT >::operator+(), NL3D::CAdvance1616Iterator< T, PT >::operator+=(), and NL3D::CAdvance1616Iterator< T, PT >::operator==().

template<typename T, typename PT>
T NL3D::CAdvance1616Iterator< T, PT >::It
 

Definition at line 92 of file ps_iterator.h.

Referenced by NL3D::CAdvance1616Iterator< T, PT >::operator==().

template<typename T, typename PT>
uint32 NL3D::CAdvance1616Iterator< T, PT >::Step
 

Definition at line 94 of file ps_iterator.h.

Referenced by NL3D::CAdvance1616Iterator< T, PT >::operator==().


The documentation for this struct was generated from the following file:
Generated on Tue Mar 16 06:44:19 2004 for NeL by doxygen 1.3.6