| 1 |
#ifndef _HCDEBUG_H_ |
| 2 |
#define _HCDEBUG_H_ |
| 3 |
|
| 4 |
class HCDebug |
| 5 |
{ |
| 6 |
public : |
| 7 |
|
| 8 |
//! ctor/dtor |
| 9 |
HCDebug( const TKString & iClass , const TKString & iName = TKString() ); |
| 10 |
virtual ~HCDebug( void ); |
| 11 |
|
| 12 |
protected : |
| 13 |
|
| 14 |
struct Global |
| 15 |
{ |
| 16 |
TKString mCommand; |
| 17 |
TKString mHelp; |
| 18 |
void (* tProc)( const TKList<TKString> & iList ); |
| 19 |
}; |
| 20 |
|
| 21 |
template <class T> |
| 22 |
struct Command |
| 23 |
{ |
| 24 |
TKString mCommand; |
| 25 |
TKString mHelp; |
| 26 |
void (T::*mProc)( const TKList<TKString> & iList ); |
| 27 |
}; |
| 28 |
|
| 29 |
//! static class vars |
| 30 |
static TKList<Global > sGlobals; |
| 31 |
static TKList<Command<HCDebug> > sCommands; |
| 32 |
static TKList<HCDebug* > sInstances; |
| 33 |
static TKCriticalSection sInstancesCS; |
| 34 |
|
| 35 |
//! data members |
| 36 |
TKString mClass; |
| 37 |
TKString mName; |
| 38 |
|
| 39 |
//! objects TSM-Handler |
| 40 |
virtual int DoHandleTSM( const TKList<TKString> & iList ); |
| 41 |
|
| 42 |
template <class T> |
| 43 |
int FindCommand( const TKList<TKString> & iList , const TKList<Command<T> > & iCommands ); |
| 44 |
|
| 45 |
|
| 46 |
};//class HCDebug |
| 47 |
|
| 48 |
|
| 49 |
#endif//_HCDEBUG_H_ |