This class implements the "singleton pattern" for C++ using a common templated approach. In case of Windows OS and DLL usage, the class overcomes the problem of having a global data segment per DLL in addition to the one associated with the process that is using the DLL.
All details about implementation and usage of this class is provided in the module's Programmer's Manual.
TDerivedClass | Template parameter that denotes the name of the class that implements the singleton. |
Definition at line 50 of file singleton.hpp.
#include <singleton.hpp>
Public Static Method Index: | |
static TDerivedClass & | GetSingleton () |
Public Method Index: | |
virtual | ~Singleton () |
Virtual destructor. | |
Protected Static Field Index: | |
static TDerivedClass * | singleton = nullptr |
A pointer to the one and only singleton. | |
|
staticprotected |
A pointer to the one and only singleton.
Definition at line 54 of file singleton.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 98 of file singleton.hpp.
|
inlinestatic |
Creates (if not done, yet) and returns the singleton of type TDerivedClass.
Definition at line 59 of file singleton.hpp.