|
ECSM v0.7.0
Entity Component System Manager
|
Base singleton class. More...
#include <singleton.hpp>
Public Types | |
| typedef T | ItemType |
Protected Member Functions | |
| Singleton (bool set=true) | |
| Creates a new singleton class instance. | |
| virtual | ~Singleton () |
| Destroys 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.
|
inlineprotected |
Creates a new singleton class instance.
| set | is singleton instance should be set |
|
inlineprotectedvirtual |
Destroys singleton class instance.
|
inlinestaticprotected |
Singleton class instance.