FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::DynamicSingleton< T > Class Template Reference

Another Singleton. More...

#include <singleton.h>

+ Inheritance diagram for FIFE::DynamicSingleton< T >:
+ Collaboration diagram for FIFE::DynamicSingleton< T >:

Public Member Functions

 DynamicSingleton ()
 
virtual ~DynamicSingleton ()
 

Static Public Member Functions

static T * instance ()
 

Private Member Functions

 DynamicSingleton (const DynamicSingleton< T > &)
 
DynamicSingleton< T & > operator= (const DynamicSingleton< T > &)
 

Static Private Attributes

static T * m_instance = 0
 

Detailed Description

template<typename T>
class FIFE::DynamicSingleton< T >

Another Singleton.

This implementations needs to be created and destroyed explicitly. That way the order of construction and destruction is well defined, so we don't get those nasty static initialization/destruction order problems.

Engine will create all standard FIFE Singletons when created (just call Engine::instance()) and destroy them on exit.

Maybe we'll change this one day to use one of those funny NiftyCounter implementations.

See also
StaticSingleton
Engine

Definition at line 82 of file singleton.h.

Constructor & Destructor Documentation

template<typename T>
FIFE::DynamicSingleton< T >::DynamicSingleton ( )
inline

Definition at line 89 of file singleton.h.

template<typename T>
virtual FIFE::DynamicSingleton< T >::~DynamicSingleton ( )
inlinevirtual

Definition at line 94 of file singleton.h.

template<typename T>
FIFE::DynamicSingleton< T >::DynamicSingleton ( const DynamicSingleton< T > &  )
inlineprivate

Definition at line 101 of file singleton.h.

Member Function Documentation

template<typename T>
static T* FIFE::DynamicSingleton< T >::instance ( )
inlinestatic

Definition at line 84 of file singleton.h.

template<typename T>
DynamicSingleton<T&> FIFE::DynamicSingleton< T >::operator= ( const DynamicSingleton< T > &  )
inlineprivate

Definition at line 102 of file singleton.h.

Member Data Documentation

template<typename T>
T * FIFE::DynamicSingleton< T >::m_instance = 0
staticprivate

Definition at line 99 of file singleton.h.


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