Pyrogenesis trunk
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
Singleton< T > Class Template Reference

Template base class for singletons. More...

#include <Singleton.h>

Public Member Functions

 Singleton ()
 
 ~Singleton ()
 

Static Public Member Functions

static TGetSingleton ()
 
static TGetSingletonPtr ()
 
static bool IsInitialised ()
 

Private Member Functions

 NONCOPYABLE (Singleton)
 

Static Private Attributes

static Tms_singleton = nullptr
 

Detailed Description

template<typename T>
class Singleton< T >

Template base class for singletons.

Usage: class MyClass : public Singleton<MyClass> {}; MyClass::GetSingleton().MyMethod();

Modified from http://gamedev.net/reference/articles/article1954.asp

Constructor & Destructor Documentation

◆ Singleton()

template<typename T >
Singleton< T >::Singleton ( )
inline

◆ ~Singleton()

template<typename T >
Singleton< T >::~Singleton ( )
inline

Member Function Documentation

◆ GetSingleton()

template<typename T >
static T & Singleton< T >::GetSingleton ( )
inlinestatic

◆ GetSingletonPtr()

template<typename T >
static T * Singleton< T >::GetSingletonPtr ( )
inlinestatic

◆ IsInitialised()

template<typename T >
static bool Singleton< T >::IsInitialised ( )
inlinestatic

◆ NONCOPYABLE()

template<typename T >
Singleton< T >::NONCOPYABLE ( Singleton< T )
private

Member Data Documentation

◆ ms_singleton

template<typename T >
T * Singleton< T >::ms_singleton = nullptr
staticprivate

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