SuperTuxKart
Static Public Member Functions | Protected Member Functions | Static Private Attributes | List of all members
AbstractSingleton< T > Class Template Reference

Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance. This is advised to re-declare getInstance, but whithout templates parameters in the inheriting classes. More...

#include <singleton.hpp>

Static Public Member Functions

template<typename S >
static S * getInstance ()
 Used to get the instance, after a dynamic cast. This is important when making a double-inheritance of this class. For example, if A is a singleton inherited by B, you can call B::getInstance<A>() to have the instance returned as a A*. If the cast fails, a log message will notify it.
 
static T * getInstance ()
 Used to get the instance.
 
static void kill ()
 Used to kill the singleton, if needed.
 

Protected Member Functions

 AbstractSingleton ()
 Constructor.
 
virtual ~AbstractSingleton ()
 Destructor.
 

Static Private Attributes

static T * m_singleton = NULL
 

Detailed Description

template<typename T>
class AbstractSingleton< T >

Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance. This is advised to re-declare getInstance, but whithout templates parameters in the inheriting classes.


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