EvEmu
0.8.4
11 September 2021
|
Template used for singleton classes. More...
#include "Singleton.h"
Public Member Functions | |
Singleton () | |
Primary constructor. More... | |
Static Public Member Functions | |
static X & | get () |
Static Protected Attributes | |
static std::shared_ptr< X > | mInstance |
Template used for singleton classes.
This template shall be used as base for classes which are intended to be singleton (i.e. there should be only 1 instance of this class at all).
Uses lazy construction (i.e. object is constructed on first access request).
Definition at line 43 of file Singleton.h.
Primary constructor.
Checks if the instance being constructed is first, i.e. mInstance hasn't been filled yet. This only makes sense if the actual class is derived from Singleton.
Definition at line 53 of file Singleton.h.
|
inlinestatic |
|
staticprotected |
Pointer to the singleton instance.
Definition at line 69 of file Singleton.h.
Referenced by Singleton< ConsoleCommand >::get(), and Singleton< ConsoleCommand >::Singleton().