Public Member Functions | Protected Attributes

cPointerMapWatcher< KeyT, ValueT, CmpT > Class Template Reference

#include <hashWatch.h>

List of all members.

Public Member Functions

 cPointerMapWatcher (const char *name, std::map< KeyT, ValueT, CmpT > &var)
const char * getClassName () const
virtual const char * getElemTypeName () 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

Detailed Description

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

Definition at line 210 of file hashWatch.h.


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]

Definition at line 218 of file hashWatch.h.

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


Member Function Documentation

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

Definition at line 225 of file hashWatch.h.

                                          {
            if (i==0) {
                it=m.begin(); itPos=0;
            } else if (i==itPos+1 && it!=m.end()) {
                ++it; ++itPos;
            } else {
                it=m.begin();
                for (int k=0; k<i && it!=m.end(); k++) ++it;
                itPos=i;
            }
            if (it==m.end()) {
                return std::string("out of bounds");
            }
            return atIt();
        }

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

Definition at line 240 of file hashWatch.h.

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

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

Definition at line 222 of file hashWatch.h.

{return classname.c_str();}

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

Definition at line 223 of file hashWatch.h.

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

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

Definition at line 224 of file hashWatch.h.

{return m.size();}


Member Data Documentation

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

Definition at line 216 of file hashWatch.h.

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

Definition at line 214 of file hashWatch.h.

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

Definition at line 215 of file hashWatch.h.

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

Definition at line 213 of file hashWatch.h.


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