#include <cddefines.h>
Inherited by t_ADfA, and t_debug.
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 147 of file cddefines.h.
static T& Singleton< T >::Inst | ( | ) | [inline, static] |
Definition at line 150 of file cddefines.h.
Referenced by ContCreatePointers(), ContSetIntensity(), debugtrace< lgTrace >::debugtrace(), HCSAR_interp(), InitBinAugerData(), ion_collis(), ion_recom_calculate(), ipShells(), iso_collisional_ionization(), iso_create(), iso_radiative_recomb(), iso_radrecomb_from_cross_section(), iso_recomb_setup(), lines(), Opacity_iso_photo_cs(), OpacityCreate1Element(), OpacityCreateAll(), pah1_fun(), ParseSet(), PresTotCurrent(), save_opacity(), SaveDo(), SaveLineData(), zero(), and debugtrace< lgTrace >::~debugtrace().