i6engine  1.0
i6e::utils::Singleton< T, Dependencies > Class Template Reference

Derive from this templated class to make a class a singleton. Refer to the Singleton Design Pattern if it is not clear what a singleton is. Declare the ctor private but destructor public (because of destruction is handled by shared_ptr) T = type of new Singleton class Dependencies = dependencies of this Singleton, will be initialized before this Singleton is initialized and destroyed after this one is destroyed. More...

#include <D:/Projekte/i6engine/libs/i6engine-utils/include/i6engine/utils/Singleton.h>

Static Public Member Functions

static T * GetSingletonPtr ()
 Returns a pointer to the Singleton class. More...
 
static T & GetSingleton ()
 Returns a reference to the Singleton class. More...
 

Protected Member Functions

 Singleton ()
 
virtual ~Singleton ()
 

Detailed Description

template<typename T, typename... Dependencies>
class i6e::utils::Singleton< T, Dependencies >

Derive from this templated class to make a class a singleton. Refer to the Singleton Design Pattern if it is not clear what a singleton is. Declare the ctor private but destructor public (because of destruction is handled by shared_ptr) T = type of new Singleton class Dependencies = dependencies of this Singleton, will be initialized before this Singleton is initialized and destroyed after this one is destroyed.

Definition at line 44 of file Singleton.h.

Constructor & Destructor Documentation

template<typename T, typename... Dependencies>
i6e::utils::Singleton< T, Dependencies >::Singleton ( )
inlineprotected

Definition at line 61 of file Singleton.h.

template<typename T, typename... Dependencies>
virtual i6e::utils::Singleton< T, Dependencies >::~Singleton ( )
inlineprotectedvirtual

Definition at line 64 of file Singleton.h.

Member Function Documentation

template<typename T, typename... Dependencies>
static T& i6e::utils::Singleton< T, Dependencies >::GetSingleton ( )
inlinestatic

Returns a reference to the Singleton class.

Definition at line 56 of file Singleton.h.

template<typename T, typename... Dependencies>
static T* i6e::utils::Singleton< T, Dependencies >::GetSingletonPtr ( )
inlinestatic

Returns a pointer to the Singleton class.

Definition at line 49 of file Singleton.h.


The documentation for this class was generated from the following file: