10 #ifndef SUPPORTLIB_SINGLETON_H
11 #define SUPPORTLIB_SINGLETON_H
62 template<
typename... Args>
static T*
getInstance(Args... args){
63 if(m_Instance==
nullptr)
64 m_Instance.reset(
new T{ std::forward<Args>(args)... });
65 return m_Instance.get();
82 inline static std::unique_ptr<T> m_Instance;
Base class of all classes.
Base Class of all classes.
Definition: Object.h:33
Singleton Template Class.
Definition: Singleton.h:54
static void destroy()
Destroys the Object held by the Singleton.
Definition: Singleton.h:70
static T * getInstance(Args... args)
Generates a static Variable which can only be instanced once. Parameters depend on the inheriting cla...
Definition: Singleton.h:62
Namespace for giri's C++ support library.
Definition: Base64.h:47