#include <cddefines.h>
Inherited by t_debug, t_nodebug, and t_PredCont.
Static Public Member Functions | |
static T & | Inst () |
Singleton: template to construct classes where a single instance can be accessed across the entire program. Construct your class as follows:
class t_myclass : public Singleton<t_myclass> { friend class Singleton<t_myclass>; protected: t_myclass(); // make sure the contructor is protected! public: long myfunc() const { return 43; } };
and use as follows throughout the code:
long l = t_myclass::Inst().myfunc();
NB NB - This implementation is not threadsafe !!
Definition at line 174 of file cddefines.h.
static T& Singleton< T >::Inst | ( | ) | [inline, static] |
Definition at line 177 of file cddefines.h.
Referenced by iter_end_check(), lines_continuum(), optimize_func(), ParseOptimize(), ParseSet(), and ParseStop().