Base singleton class. More...
#include <singleton.hpp>
Public Types | |
typedef T | ItemType |
typedef Singleton< T, UseManager > | Instance |
Protected Member Functions | |
Singleton (bool set=true) | |
Creates a new singleton class instance. | |
void | setSingleton () |
Sets a new class singleton instance. | |
void | unsetSingleton () noexcept |
Unsets this class singleton instance. |
Static Protected Attributes | |
static T * | singletonInstance = nullptr |
Base singleton class.
Singleton class is a class designed in such a way that only one instance of it can exist during the runtime of the game or application. This pattern is often used to manage systems or resources that need to be globally accessible, without having multiple copies floating around, which could lead to resource inefficiency or bugs.
T | type of the singleton class |
UseManager | use manager system instance if singleton is not set |
typedef T ItemType |
Type of the singleton class.
Singleton instance class type.
|
inlineprotected |
Creates a new singleton class instance.
set | is singleton instance should be set |
|
inlinestaticprotected |
Singleton class instance.