cPointerMapWatcher< KeyT, ValueT, CmpT > Class Template Reference

#include <hashWatch.h>

List of all members.

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


Public Member Functions

 cPointerMapWatcher (const char *name, std::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

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

Constructor & Destructor Documentation

template<class KeyT, class ValueT, class CmpT>
cPointerMapWatcher< KeyT, ValueT, CmpT >::cPointerMapWatcher ( const char *  name,
std::map< KeyT, ValueT, CmpT > &  var 
) [inline]

00129                                                                             : cStdVectorWatcherBase(name), m(var) {
00130             itPos=-1;
00131             classname = std::string("pointer_map<")+opp_typename(typeid(KeyT))+","+opp_typename(typeid(ValueT))+">";
00132         }


Member Function Documentation

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

00133 {return classname.c_str();}

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

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

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

00135 {return m.size();}

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

00136                                           {
00137             if (i==0) {
00138                 it=m.begin(); itPos=0;
00139             } else if (i==itPos+1 && it!=m.end()) {
00140                 ++it; ++itPos;
00141             } else {
00142                 it=m.begin();
00143                 for (int k=0; k<i && it!=m.end(); k++) ++it;
00144                 itPos=i;
00145             }
00146             if (it==m.end()) {
00147                 return std::string("out of bounds");
00148             }
00149             return atIt();
00150         }

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

00151                                        {
00152             std::stringstream out;
00153             out << it->first << " ==> " << *(it->second);
00154             return out.str();
00155         }


Member Data Documentation

template<class KeyT, class ValueT, class CmpT>
std::map<KeyT,ValueT,CmpT>& cPointerMapWatcher< KeyT, ValueT, CmpT >::m [protected]

template<class KeyT, class ValueT, class CmpT>
std::map<KeyT,ValueT,CmpT>::iterator cPointerMapWatcher< KeyT, ValueT, CmpT >::it [mutable, protected]

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

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


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

Generated on Fri Sep 19 13:05:06 2008 for ITM OverSim by  doxygen 1.5.5