cHashMapWatcher< KeyT, ValueT, CmpT > Class Template Reference

#include <hashWatch.h>

List of all members.

template<class KeyT, class ValueT, class CmpT>
class cHashMapWatcher< KeyT, ValueT, CmpT >


Public Member Functions

 cHashMapWatcher (const char *name, __gnu_cxx::hash_map< KeyT, ValueT, CmpT > &var)
const char * className () const
virtual const char * elemTypeName () const
virtual int size () const
virtual std::string at (int i) const
virtual std::string atIt () const

Protected Attributes

__gnu_cxx::hash_map
< KeyT, ValueT, CmpT > & 
m
__gnu_cxx::hash_map
< KeyT, ValueT, CmpT >
::iterator 
it
int itPos
std::string classname

Constructor & Destructor Documentation

template<class KeyT, class ValueT, class CmpT>
cHashMapWatcher< KeyT, ValueT, CmpT >::cHashMapWatcher ( const char *  name,
__gnu_cxx::hash_map< KeyT, ValueT, CmpT > &  var 
) [inline]

00086                                                                                     : cStdVectorWatcherBase(name), m(var) {
00087             itPos=-1;
00088             classname = std::string("ext::hash_map<")+opp_typename(typeid(KeyT))+","+opp_typename(typeid(ValueT))+">";
00089         }


Member Function Documentation

template<class KeyT, class ValueT, class CmpT>
const char* cHashMapWatcher< KeyT, ValueT, CmpT >::className (  )  const [inline]

00090 {return classname.c_str();}

template<class KeyT, class ValueT, class CmpT>
virtual const char* cHashMapWatcher< KeyT, ValueT, CmpT >::elemTypeName (  )  const [inline, virtual]

00091 {return "struct pair<*,*>";}

template<class KeyT, class ValueT, class CmpT>
virtual int cHashMapWatcher< KeyT, ValueT, CmpT >::size (  )  const [inline, virtual]

00092 {return m.size();}

template<class KeyT, class ValueT, class CmpT>
virtual std::string cHashMapWatcher< KeyT, ValueT, CmpT >::at ( int  i  )  const [inline, virtual]

00093                                           {
00094             if (i==0) {
00095                 it=m.begin(); itPos=0;
00096             } else if (i==itPos+1 && it!=m.end()) {
00097                 ++it; ++itPos;
00098             } else {
00099                 it=m.begin();
00100                 for (int k=0; k<i && it!=m.end(); k++) ++it;
00101                 itPos=i;
00102             }
00103             if (it==m.end()) {
00104                 return std::string("out of bounds");
00105             }
00106             return atIt();
00107         }

template<class KeyT, class ValueT, class CmpT>
virtual std::string cHashMapWatcher< KeyT, ValueT, CmpT >::atIt (  )  const [inline, virtual]

00108                                        {
00109             std::stringstream out;
00110             out << it->first << " ==> " << it->second;
00111             return out.str();
00112         }


Member Data Documentation

template<class KeyT, class ValueT, class CmpT>
__gnu_cxx::hash_map<KeyT,ValueT,CmpT>& cHashMapWatcher< KeyT, ValueT, CmpT >::m [protected]

template<class KeyT, class ValueT, class CmpT>
__gnu_cxx::hash_map<KeyT,ValueT,CmpT>::iterator cHashMapWatcher< KeyT, ValueT, CmpT >::it [mutable, protected]

template<class KeyT, class ValueT, class CmpT>
int cHashMapWatcher< KeyT, ValueT, CmpT >::itPos [mutable, protected]

template<class KeyT, class ValueT, class CmpT>
std::string cHashMapWatcher< KeyT, ValueT, CmpT >::classname [protected]


The documentation for this class was generated from the following file:
Generated on Thu Apr 17 13:19:28 2008 for ITM OverSim by  doxygen 1.5.3