NAMD
Public Member Functions | List of all members
UniqueSetIter< Type > Class Template Reference

#include <UniqueSet.h>

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 Type>
class UniqueSetIter< Type >

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

Definition at line 17 of file UniqueSet.h.

Constructor & Destructor Documentation

template<class Type>
UniqueSetIter< Type >::UniqueSetIter ( void  )
inline

Definition at line 29 of file UniqueSetIter.h.

29 { us = NULL; eg = NULL; index = 0; }
template<class Type>
UniqueSetIter< Type >::UniqueSetIter ( UniqueSet< T > &  us_param)
inline

Definition at line 31 of file UniqueSetIter.h.

References UniqueSetRaw< Elem >::globHead.

31  {
32  us = &us_param; eg = us_param.rep->globHead; index = 0;
33  }
EntryGlob< Elem > * globHead
Definition: UniqueSetRaw.h:281
template<class Type>
UniqueSetIter< Type >::UniqueSetIter ( const UniqueSetIter< T > &  iter)
inline

Definition at line 35 of file UniqueSetIter.h.

35  {
36  us = iter.us; eg = iter.eg; index = iter.index;
37  }
template<class Type>
UniqueSetIter< Type >::~UniqueSetIter ( void  )
inline

Definition at line 43 of file UniqueSetIter.h.

43 {}

Member Function Documentation

template<class Type>
UniqueSetIter<T> UniqueSetIter< Type >::begin ( void  ) const
inline
template<class Type>
UniqueSetIter<T> UniqueSetIter< Type >::end ( void  ) const
inline
template<class Type>
void UniqueSetIter< Type >::gotoUsed ( void  )
inline

Definition at line 102 of file UniqueSetIter.h.

References Entry< Elem >::isUsed(), and EntryGlob< Elem >::next().

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

102  {
103  while (eg) {
104  for(;index < us->rep->globSize; index++) {
105  if (eg->glob[index].isUsed()) break;
106  }
107  if (index < us->rep->globSize) break;
108  index = 0;
109  eg = eg->next();
110  }
111  if (!eg) index = 0;
112  }
EntryGlob< Elem > * next(void)
Definition: UniqueSetRaw.h:95
int isUsed(void) const
Definition: UniqueSetRaw.h:47
template<class Type>
int UniqueSetIter< Type >::operator!= ( const UniqueSetIter< T > &  iter) const
inline

Definition at line 72 of file UniqueSetIter.h.

72  {
73  return (iter.index != index || iter.eg != eg);
74  }
template<class Type>
T& UniqueSetIter< Type >::operator* ( void  )
inline

Definition at line 93 of file UniqueSetIter.h.

References UniqueSetIter< Type >::gotoUsed(), and Entry< Elem >::obj.

93  {
94  gotoUsed();
95  return *((T *)&(eg->glob[index].obj));
96  }
Elem obj
Definition: UniqueSetRaw.h:36
void gotoUsed(void)
template<class Type>
UniqueSetIter<T> UniqueSetIter< Type >::operator++ ( void  )
inline

Definition at line 80 of file UniqueSetIter.h.

References UniqueSetIter< Type >::gotoUsed().

80  {
81  index++;
82  gotoUsed();
83  return (*this);
84  }
void gotoUsed(void)
template<class Type>
UniqueSetIter<T> UniqueSetIter< Type >::operator++ ( int  )
inline

Definition at line 86 of file UniqueSetIter.h.

References UniqueSetIter< Type >::gotoUsed().

86  {
87  UniqueSetIter<T> tmp(*this);
88  index++;
89  gotoUsed();
90  return (tmp);
91  }
void gotoUsed(void)
template<class Type>
T* UniqueSetIter< Type >::operator-> ( void  )
inline

Definition at line 45 of file UniqueSetIter.h.

References UniqueSetIter< Type >::gotoUsed(), and Entry< Elem >::obj.

45  {
46  gotoUsed();
47  if (eg)
48  return (T *)&(eg->glob[index].obj);
49  else {
50  index = 0;
51  return(NULL);
52  }
53  }
Elem obj
Definition: UniqueSetRaw.h:36
void gotoUsed(void)
template<class Type>
UniqueSetIter<T>& UniqueSetIter< Type >::operator= ( const UniqueSetIter< T > &  iter)
inline

Definition at line 39 of file UniqueSetIter.h.

39  {
40  us = iter.us; eg = iter.eg; index = iter.index; return (*this);
41  }
template<class Type>
int UniqueSetIter< Type >::operator== ( const UniqueSetIter< T > &  iter) const
inline

Definition at line 76 of file UniqueSetIter.h.

76  {
77  return (!operator!=(iter));
78  }
template<class Type>
void UniqueSetIter< Type >::status ( void  )
inline

Definition at line 98 of file UniqueSetIter.h.

98  {
99  std::cout << "Index is " << index << " addr is " << eg << std::endl;
100  }

The documentation for this class was generated from the following files: