Orxonox
0.0.5 Codename: Arcturus
|
Base for singleton classes. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/Singleton.h>
Static Public Member Functions | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static T & | getInstance () |
Returns a reference to the singleton instance. More... | |
Protected Member Functions | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
Private Member Functions | |
Singleton (const Singleton &)=delete | |
Singleton & | operator= (const Singleton &)=delete |
Base for singleton classes.
Usage: Inherit publicly from Singleton<MyClass> and provide access to MyClass::singletonPtr_s. This can easily be done with a friend declaration.
See this example for an exemplary implementation.
|
inlineprotected |
Constructor sets the singleton instance pointer.
|
inlineprotectedvirtual |
Destructor resets the singleton instance pointer.
|
privatedelete |
|
inlinestatic |
Tells whether the singleton has been created.
|
inlinestatic |
Returns a reference to the singleton instance.
|
privatedelete |