cDequeWatcher< T > Class Template Reference

#include <hashWatch.h>

List of all members.

Public Member Functions

 cDequeWatcher (const char *name, std::deque< T > &var)
const char * className () 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::deque< T > & v
std::string classname
std::deque< T >::iterator it
int itPos

Detailed Description

template<class T>
class cDequeWatcher< T >

Definition at line 78 of file hashWatch.h.


Constructor & Destructor Documentation

template<class T>
cDequeWatcher< T >::cDequeWatcher ( const char *  name,
std::deque< T > &  var 
) [inline]

Definition at line 86 of file hashWatch.h.

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


Member Function Documentation

template<class T>
virtual std::string cDequeWatcher< T >::at ( int  i  )  const [inline, virtual]

Definition at line 93 of file hashWatch.h.

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

template<class T>
virtual std::string cDequeWatcher< T >::atIt (  )  const [inline, virtual]

Definition at line 108 of file hashWatch.h.

00108                                        {
00109             std::stringstream out;
00110             out << (*it);
00111             return out.str();
00112         }

template<class T>
const char* cDequeWatcher< T >::className (  )  const [inline]

Definition at line 90 of file hashWatch.h.

00090 {return classname.c_str();}

template<class T>
virtual const char* cDequeWatcher< T >::getElemTypeName (  )  const [inline, virtual]

Definition at line 91 of file hashWatch.h.

00091 {return opp_typename(typeid(T));}

template<class T>
virtual int cDequeWatcher< T >::size (  )  const [inline, virtual]

Definition at line 92 of file hashWatch.h.

00092 {return v.size();}


Member Data Documentation

template<class T>
std::string cDequeWatcher< T >::classname [protected]

Definition at line 82 of file hashWatch.h.

template<class T>
std::deque<T>::iterator cDequeWatcher< T >::it [mutable, protected]

Definition at line 83 of file hashWatch.h.

template<class T>
int cDequeWatcher< T >::itPos [mutable, protected]

Definition at line 84 of file hashWatch.h.

template<class T>
std::deque<T>& cDequeWatcher< T >::v [protected]

Definition at line 81 of file hashWatch.h.


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