UniqueSetIter< T > Class Template Reference

#include <UniqueSetIter.h>

List of all members.

Public Member Functions

 UniqueSetIter (void)
 UniqueSetIter (UniqueSet< T > &us_param)
 UniqueSetIter (const UniqueSetIter< T > &iter)
UniqueSetIter< T > & operator= (const UniqueSetIter< T > &iter)
 ~UniqueSetIter (void)
T * operator-> (void)
UniqueSetIter< T > begin (void) const
UniqueSetIter< T > end (void) const
int operator!= (const UniqueSetIter< T > &iter) const
int operator== (const UniqueSetIter< T > &iter) const
UniqueSetIter< T > operator++ (void)
UniqueSetIter< T > operator++ (int)
T & operator * (void)
void status (void)
void gotoUsed (void)


Detailed Description

template<class T>
class UniqueSetIter< T >

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 19 of file UniqueSetIter.h.


Constructor & Destructor Documentation

template<class T>
UniqueSetIter< T >::UniqueSetIter ( void   )  [inline]

Definition at line 29 of file UniqueSetIter.h.

00029 { us = NULL; eg = NULL; index = 0; }

template<class T>
UniqueSetIter< T >::UniqueSetIter ( UniqueSet< T > &  us_param  )  [inline]

Definition at line 31 of file UniqueSetIter.h.

References UniqueSetRaw< Elem >::globHead, and UniqueSet< Elem >::rep.

00031                                           { 
00032        us = &us_param; eg = us_param.rep->globHead; index = 0;
00033     }

template<class T>
UniqueSetIter< T >::UniqueSetIter ( const UniqueSetIter< T > &  iter  )  [inline]

Definition at line 35 of file UniqueSetIter.h.

References UniqueSetIter< T >::eg, UniqueSetIter< T >::index, and UniqueSetIter< T >::us.

00035                                                 {
00036        us = iter.us; eg = iter.eg; index = iter.index;
00037     }

template<class T>
UniqueSetIter< T >::~UniqueSetIter ( void   )  [inline]

Definition at line 43 of file UniqueSetIter.h.

00043 {}


Member Function Documentation

template<class T>
UniqueSetIter<T> UniqueSetIter< T >::begin ( void   )  const [inline]

Definition at line 55 of file UniqueSetIter.h.

References UniqueSetIter< T >::eg, UniqueSetRaw< Elem >::globHead, UniqueSetIter< T >::gotoUsed(), UniqueSetIter< T >::index, UniqueSet< Elem >::rep, and UniqueSetIter< T >::us.

Referenced by buildExclusions(), ComputeHomeTuples< AnisoElem, aniso, aniso >::doWork(), BroadcastMgr::recvBroadcast(), ProxyMgr::removeProxies(), ProxyMgr::removeUnusedProxies(), ParallelIOMgr::wrapCoor(), BroadcastMgr::~BroadcastMgr(), and ComputeSelfTuples< AnisoElem, aniso, aniso >::~ComputeSelfTuples().

00055                                        {
00056         UniqueSetIter<T> iter;
00057         iter.us = us;
00058         iter.index = 0;
00059         iter.eg = us->rep->globHead;
00060         iter.gotoUsed();
00061         return(iter);
00062     }

template<class T>
UniqueSetIter<T> UniqueSetIter< T >::end ( void   )  const [inline]

Definition at line 64 of file UniqueSetIter.h.

References UniqueSetIter< T >::eg, UniqueSetIter< T >::index, and UniqueSetIter< T >::us.

Referenced by buildExclusions(), ComputeHomeTuples< AnisoElem, aniso, aniso >::doWork(), BroadcastMgr::recvBroadcast(), ProxyMgr::removeProxies(), ProxyMgr::removeUnusedProxies(), ParallelIOMgr::wrapCoor(), BroadcastMgr::~BroadcastMgr(), and ComputeSelfTuples< AnisoElem, aniso, aniso >::~ComputeSelfTuples().

00064                                      {
00065         UniqueSetIter<T> iter;
00066         iter.us = us;
00067         iter.index = 0;
00068         iter.eg = NULL;
00069         return(iter);
00070     }

template<class T>
void UniqueSetIter< T >::gotoUsed ( void   )  [inline]

Definition at line 102 of file UniqueSetIter.h.

References EntryGlob< Elem >::glob, UniqueSetRaw< Elem >::globSize, EntryGlob< Elem >::next(), and UniqueSet< Elem >::rep.

Referenced by UniqueSetIter< T >::begin(), UniqueSetIter< T >::operator *(), UniqueSetIter< T >::operator++(), and UniqueSetIter< T >::operator->().

00102                         {
00103       while (eg) {
00104         for(;index < us->rep->globSize; index++) {
00105           if (eg->glob[index].isUsed()) break;
00106         }
00107         if (index < us->rep->globSize) break;
00108         index = 0;
00109         eg = eg->next();
00110       }
00111       if (!eg) index = 0;
00112     }

template<class T>
T& UniqueSetIter< T >::operator * ( void   )  [inline]

Definition at line 93 of file UniqueSetIter.h.

References EntryGlob< Elem >::glob, and UniqueSetIter< T >::gotoUsed().

00093                         {
00094        gotoUsed();
00095        return *((T *)&(eg->glob[index].obj));
00096     }

template<class T>
int UniqueSetIter< T >::operator!= ( const UniqueSetIter< T > &  iter  )  const [inline]

Definition at line 72 of file UniqueSetIter.h.

References UniqueSetIter< T >::eg, and UniqueSetIter< T >::index.

00072                                                         {
00073         return (iter.index != index || iter.eg != eg);
00074     }

template<class T>
UniqueSetIter<T> UniqueSetIter< T >::operator++ ( int   )  [inline]

Definition at line 86 of file UniqueSetIter.h.

References UniqueSetIter< T >::gotoUsed().

00086                                      {
00087        UniqueSetIter<T> tmp(*this);
00088        index++;
00089        gotoUsed();
00090        return (tmp);
00091     }

template<class T>
UniqueSetIter<T> UniqueSetIter< T >::operator++ ( void   )  [inline]

Definition at line 80 of file UniqueSetIter.h.

References UniqueSetIter< T >::gotoUsed().

00080                                       {
00081       index++;
00082       gotoUsed();
00083       return (*this);
00084     }

template<class T>
T* UniqueSetIter< T >::operator-> ( void   )  [inline]

Definition at line 45 of file UniqueSetIter.h.

References EntryGlob< Elem >::glob, UniqueSetIter< T >::gotoUsed(), and Entry< Elem >::obj.

00045                         { 
00046       gotoUsed();
00047       if (eg)
00048         return (T *)&(eg->glob[index].obj);
00049       else { 
00050         index = 0;
00051         return(NULL);
00052       }
00053     }

template<class T>
UniqueSetIter<T>& UniqueSetIter< T >::operator= ( const UniqueSetIter< T > &  iter  )  [inline]

Definition at line 39 of file UniqueSetIter.h.

References UniqueSetIter< T >::eg, UniqueSetIter< T >::index, and UniqueSetIter< T >::us.

00039                                                                {
00040        us = iter.us; eg = iter.eg; index = iter.index; return (*this);
00041     }

template<class T>
int UniqueSetIter< T >::operator== ( const UniqueSetIter< T > &  iter  )  const [inline]

Definition at line 76 of file UniqueSetIter.h.

00076                                                         {
00077         return (!operator!=(iter));
00078     }

template<class T>
void UniqueSetIter< T >::status ( void   )  [inline]

Definition at line 98 of file UniqueSetIter.h.

00098                       {
00099       std::cout << "Index is " << index << " addr is " << eg << std::endl;
00100     }


The documentation for this class was generated from the following file:
Generated on Wed Sep 20 01:17:20 2017 for NAMD by  doxygen 1.4.7