#include <cddefines.h>
Inherited by t_ADfA, t_debug, t_fe2ovr_la, t_lfact, t_version, and t_yield.
Inheritance diagram for Singleton< T >:
Static Public Member Functions | |
static T & | Inst () |
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 103 of file cddefines.h.
static T& Singleton< T >::Inst | ( | ) | [inline, static] |
Definition at line 106 of file cddefines.h.
Referenced by cdDate(), cdVersion(), debugtrace< lgTrace >::debugtrace(), GammaBnPL(), GammaPrtShells(), HCSAR_interp(), hlike_radrecomb_from_cross_section(), InitBinAugerData(), ion_collis(), ion_photo(), ion_recom_calculate(), ipShells(), iso_collisional_ionization(), iso_create(), iso_radiative_recomb(), iso_recomb_setup(), lfactorial(), lines(), mie_write_opc(), Opacity_iso_photo_cs(), OpacityCreate1Element(), pah1_fun(), ParseDont(), ParsePrint(), ParsePunch(), ParseSet(), PrtComment(), PrtFinal(), ShowMe(), writeCloudyDetails(), zero(), and debugtrace< lgTrace >::~debugtrace().