cStdMultiMapWatcher< KeyT, ValueT, CmpT > Class Template Reference

#include <hashWatch.h>

List of all members.

Public Member Functions

 cStdMultiMapWatcher (const char *name, std::multimap< 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::multimap< KeyT, ValueT,
CmpT > & 
m
std::multimap< KeyT, ValueT,
CmpT >::iterator 
it
int itPos
std::string classname

Detailed Description

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

Definition at line 210 of file hashWatch.h.


Constructor & Destructor Documentation

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

Definition at line 218 of file hashWatch.h.

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


Member Function Documentation

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

Definition at line 225 of file hashWatch.h.

00225                                       {
00226         // std::map doesn't support random access iterator and iteration is slow,
00227         // so we have to use a trick, knowing that Tkenv will call this function with
00228         // i=0, i=1, etc...
00229         if (i==0) {
00230             it=m.begin(); itPos=0;
00231         } else if (i==itPos+1 && it!=m.end()) {
00232             ++it; ++itPos;
00233         } else {
00234             it=m.begin();
00235             for (int k=0; k<i && it!=m.end(); k++) ++it;
00236             itPos=i;
00237         }
00238         if (it==m.end()) {
00239             return std::string("out of bounds");
00240         }
00241         return atIt();
00242     }

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

Definition at line 243 of file hashWatch.h.

Referenced by cStdMultiMapWatcher< KeyT, ValueT, CmpT >::at().

00243                                    {
00244         std::stringstream out;
00245         out << it->first << " ==> " << it->second;
00246         return out.str();
00247     }

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

Definition at line 222 of file hashWatch.h.

00222 {return classname.c_str();}

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

Definition at line 223 of file hashWatch.h.

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

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

Definition at line 224 of file hashWatch.h.

00224 {return m.size();}


Member Data Documentation

template<class KeyT, class ValueT, class CmpT>
std::string cStdMultiMapWatcher< KeyT, ValueT, CmpT >::classname [protected]
template<class KeyT, class ValueT, class CmpT>
std::multimap<KeyT,ValueT,CmpT>::iterator cStdMultiMapWatcher< KeyT, ValueT, CmpT >::it [mutable, protected]
template<class KeyT, class ValueT, class CmpT>
int cStdMultiMapWatcher< KeyT, ValueT, CmpT >::itPos [mutable, protected]
template<class KeyT, class ValueT, class CmpT>
std::multimap<KeyT,ValueT,CmpT>& cStdMultiMapWatcher< KeyT, ValueT, CmpT >::m [protected]

The documentation for this class was generated from the following file:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3