|
DART 6.12.2
|
Singleton template class. More...
#include <Singleton.hpp>
Static Public Member Functions | |
| template<typename... Args> | |
| static T & | getSingleton (Args... _args) |
| Returns reference of the singleton. | |
| template<typename... Args> | |
| static T * | getSingletonPtr (Args... _args) |
| Returns pointer of the singleton. | |
Protected Member Functions | |
| Singleton ()=default | |
| Constructor. | |
| virtual | ~Singleton ()=default |
| Destructor. | |
Private Member Functions | |
| Singleton (const T &)=delete | |
| Don't implement copy constructor. | |
| const T & | operator= (const T &)=delete |
| Don't assignment operator. | |
Static Private Attributes | |
| static T * | mInstance = nullptr |
| Singleton instance. | |
Singleton template class.
// Singletone class Engine class Engine : public Singleton<Engine> {};
// Call before main() and use theT only instead of calling getSingleton() static T& theT = T::getSingleton();
|
protecteddefault |
Constructor.
|
protectedvirtualdefault |
Destructor.
|
privatedelete |
Don't implement copy constructor.
|
static |
Returns reference of the singleton.
|
static |
Returns pointer of the singleton.
|
privatedelete |
Don't assignment operator.
|
staticprivate |
Singleton instance.