#include <Singleton.hh>
This is a base class for all classes that use the singleton pattern.
Static Public Member Functions | |
| void | destroy (void) |
| Destroy the singleton class instance. | |
| T * | instance (void) |
| Return a pointer to the singleton class instance. | |
Protected Member Functions | |
| Singleton (void) | |
Related Functions | |
| (Note that these are not member functions.) | |
| SINGLETON_IMPL(T) | |
| Macro for implementing a singleton class. | |
| SINGLETON_DECL(T) | |
| Macro for defining a singleton class. | |
| SINGLETON_DECL2(T, S) | |
| Macro for defining a singleton class which has a single superclass. | |
|
||||||||||
|
This constructor is defined protected to prevent explicit creation of the class instance by others. |
|
||||||||||
|
Destroy the singleton class instance. This method destroys the single instance of the derived class. This method is important for proper destruction of the singleton instance. It must be called externally somewhere to ensure that the instance is destroyed before program exit. |
|
||||||||||
|
Return a pointer to the singleton class instance. This method returns a pointer to the single instance of the singleton class. If it had not been [previously created, it creates the instance. |
|
||||||||||
|
Macro for defining a singleton class. Does the C++ template magic to declare a class T as a singleton class.
|
|
|||||||||||||
|
Macro for defining a singleton class which has a single superclass. Does the C++ template magic to declare a class T, which is a subclass of class S, as a singleton class.
|
|
||||||||||
|
Macro for implementing a singleton class. Does the C++ magic necessary to implement class T as a singleton class. This must be in exactly one source file for each singleton class in order to implement the various static member variables of the interface.
|