IteratorTableau< T > Class Template Reference

#include <iterator_array.h>

Inheritance diagram for IteratorTableau< T >:

Inheritance graph
[legend]
Collaboration diagram for IteratorTableau< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Contener< T, Iterator<
T, IteratorTableau< T > > > 
myContener
 type of associated contener
typedef Iterator< T, IteratorTableau<
T > > 
Parent
 type of parent in heritage

Public Member Functions

T & GetFirst ()
 get fist item
T & GetNext ()
 get next item in course
 IteratorTableau (ContenerTableau< T > &c)

Private Attributes

int index_courant
 current index in course
int index_debut
 first index in course
int index_fin
 last index in course
invalid_ref
 reference to invalid item
T ** tab_parcours
 pointer to avoid over-cost in using STL vector

Detailed Description

template<typename T>
class IteratorTableau< T >

Class IteratorTableau Generic iterator over array conteners

Definition at line 60 of file iterator_array.h.


Member Typedef Documentation

template<typename T>
typedef Contener<T,Iterator<T,IteratorTableau<T> > > IteratorTableau< T >::myContener

type of associated contener

Definition at line 65 of file iterator_array.h.

template<typename T>
typedef Iterator<T,IteratorTableau<T> > IteratorTableau< T >::Parent

type of parent in heritage

Definition at line 67 of file iterator_array.h.


Constructor & Destructor Documentation

template<typename T>
IteratorTableau< T >::IteratorTableau ( ContenerTableau< T > &  c  )  [inline]

Definition at line 69 of file iterator_array.h.

00069                                         :
00070     Iterator<T,IteratorTableau<T> >(c),
00071     index_courant(0),
00072     index_debut(0)
00073     {
00074       //TODO améliorer les classe de conteneur et iterateur en définissant le type T
00075       ContenerTableau<T> & cont = static_cast<ContenerTableau<T> &>(Parent::my_cont);
00076       index_fin = cont.nbElem();
00077       };
  


Member Function Documentation

template<typename T>
T& IteratorTableau< T >::GetFirst (  )  [inline]

get fist item

Reimplemented from Iterator< T, IteratorTableau< T > >.

Definition at line 80 of file iterator_array.h.

Referenced by FormeFaible< DomainA, DomainC, Dim >::ApplyAtomsCorrection(), FormeFaible< DomainA, DomainC, Dim >::BuildAtomsRHS(), Bridging< DomainA, DomainC, Dim, Pond >::BuildAtomsWeight(), BelytschkoFull< DomainA, DomainC, Dim >::BuildConstraintMatrix(), FormeFaible< DomainA, DomainC, Dim >::BuildContinuConstraintMatrix(), LeastSquare< DomainA, DomainC, Dim >::BuildLeastSquareRHS(), BridgingPar< DomainA, DomainC, Dim, Pond >::CorrectSurfaceEffect(), FormeFaible< DomainA, DomainC, Dim >::CorrectWeights(), LeastSquare< DomainA, DomainC, Dim >::CorrigeAtoms(), Bridging< DomainA, DomainC, Dim, Pond >::Dump(), FiltreAtom< Domain, Dim >::GetFirst(), FiltreMesh< Domain, Dim >::GetFirstElem(), and FiltreMesh< Domain, Dim >::GetFirstNode().

00080                 {
00081     Parent::end_flag = false;
00082     index_courant = 0;
00083      tab_parcours = &(static_cast<ContenerTableau<T>&>(Parent::my_cont).tableau[0]);
00084      T * t = NULL;
00085      if (static_cast<ContenerTableau<T>&>(Parent::my_cont).tableau.size() == 0){
00086        t = &(static_cast<ContenerTableau<T>&>(Parent::my_cont).NULL_ELEM);
00087        Parent::end_flag = true;   
00088      }
00089      else
00090        t = tab_parcours[index_courant];
00091     return *t;
00092   }

template<typename T>
T& IteratorTableau< T >::GetNext (  )  [inline]

get next item in course

Reimplemented from Iterator< T, IteratorTableau< T > >.

Definition at line 94 of file iterator_array.h.

Referenced by FormeFaible< DomainA, DomainC, Dim >::ApplyAtomsCorrection(), FormeFaible< DomainA, DomainC, Dim >::BuildAtomsRHS(), Bridging< DomainA, DomainC, Dim, Pond >::BuildAtomsWeight(), BelytschkoFull< DomainA, DomainC, Dim >::BuildConstraintMatrix(), FormeFaible< DomainA, DomainC, Dim >::BuildContinuConstraintMatrix(), LeastSquare< DomainA, DomainC, Dim >::BuildLeastSquareRHS(), BridgingPar< DomainA, DomainC, Dim, Pond >::CorrectSurfaceEffect(), FormeFaible< DomainA, DomainC, Dim >::CorrectWeights(), LeastSquare< DomainA, DomainC, Dim >::CorrigeAtoms(), Bridging< DomainA, DomainC, Dim, Pond >::Dump(), FiltreAtom< Domain, Dim >::GetNext(), FiltreMesh< Domain, Dim >::GetNextElem(), and FiltreMesh< Domain, Dim >::GetNextNode().

00094                {
00095     index_courant ++;
00096 
00097     if(index_courant >= index_fin){
00098       --index_courant;
00099       IteratorTableau<T>::end_flag = true;
00100     }
00101     return *tab_parcours[index_courant];
00102   }


Member Data Documentation

template<typename T>
int IteratorTableau< T >::index_courant [private]

current index in course

Definition at line 107 of file iterator_array.h.

Referenced by IteratorTableau< RefElt >::GetFirst(), and IteratorTableau< RefElt >::GetNext().

template<typename T>
int IteratorTableau< T >::index_debut [private]

first index in course

Definition at line 109 of file iterator_array.h.

template<typename T>
int IteratorTableau< T >::index_fin [private]

last index in course

Definition at line 111 of file iterator_array.h.

Referenced by IteratorTableau< RefElt >::GetNext(), and IteratorTableau< RefElt >::IteratorTableau().

template<typename T>
T IteratorTableau< T >::invalid_ref [private]

reference to invalid item

Definition at line 114 of file iterator_array.h.

template<typename T>
T** IteratorTableau< T >::tab_parcours [private]

pointer to avoid over-cost in using STL vector

Definition at line 116 of file iterator_array.h.

Referenced by IteratorTableau< RefElt >::GetFirst(), and IteratorTableau< RefElt >::GetNext().


The documentation for this class was generated from the following file:
Generated on Fri Sep 7 13:13:20 2007 for LibMultiScale by  doxygen 1.5.2