OverSim
cHashSetWatcher< T > Class Template Reference

#include <hashWatch.h>

Public Member Functions

 cHashSetWatcher (const char *name, UNORDERED_SET< T > &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

UNORDERED_SET< T > & v
std::string classname
UNORDERED_SET< T >::iterator it
int itPos

Detailed Description

template<class T>
class cHashSetWatcher< T >

Definition at line 34 of file hashWatch.h.

Constructor & Destructor Documentation

template<class T>
cHashSetWatcher< T >::cHashSetWatcher ( const char *  name,
UNORDERED_SET< T > &  var 
)
inline

Definition at line 42 of file hashWatch.h.

: cStdVectorWatcherBase(name), v(var) {
itPos=-1;
classname = std::string("unordered_set<")+opp_typename(typeid(T))+">";
}

Member Function Documentation

template<class T>
virtual std::string cHashSetWatcher< T >::at ( int  i) const
inlinevirtual

Definition at line 49 of file hashWatch.h.

{
if (i==0) {
it=v.begin(); itPos=0;
} else if (i==itPos+1 && it!=v.end()) {
++it; ++itPos;
} else {
it=v.begin();
for (int k=0; k<i && it!=v.end(); k++) ++it;
itPos=i;
}
if (it==v.end()) {
return std::string("out of bounds");
}
return atIt();
}
template<class T>
virtual std::string cHashSetWatcher< T >::atIt ( ) const
inlinevirtual

Definition at line 64 of file hashWatch.h.

{
std::stringstream out;
out << (*it);
return out.str();
}
template<class T>
const char* cHashSetWatcher< T >::getClassName ( ) const
inline

Definition at line 46 of file hashWatch.h.

{return classname.c_str();}
template<class T>
virtual const char* cHashSetWatcher< T >::getElemTypeName ( ) const
inlinevirtual

Definition at line 47 of file hashWatch.h.

{return opp_typename(typeid(T));}
template<class T>
virtual int cHashSetWatcher< T >::size ( ) const
inlinevirtual

Definition at line 48 of file hashWatch.h.

{return v.size();}

Member Data Documentation

template<class T>
std::string cHashSetWatcher< T >::classname
protected

Definition at line 38 of file hashWatch.h.

template<class T>
UNORDERED_SET<T>::iterator cHashSetWatcher< T >::it
mutableprotected

Definition at line 39 of file hashWatch.h.

template<class T>
int cHashSetWatcher< T >::itPos
mutableprotected

Definition at line 40 of file hashWatch.h.

template<class T>
UNORDERED_SET<T>& cHashSetWatcher< T >::v
protected

Definition at line 37 of file hashWatch.h.


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