CSingleton< T > Class Template Reference

#include <singleton.h>

Inheritance diagram for CSingleton< T >:

Inheritance graph
[legend]
Collaboration diagram for CSingleton< T >:

Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static T * Instance ()

Protected Member Functions

 CSingleton ()
virtual ~CSingleton ()

Private Member Functions

void _Kill ()

Static Private Attributes

static T * m_Instance = NULL


Detailed Description

template<typename T>
class CSingleton< T >

Definition at line 28 of file singleton.h.


Constructor & Destructor Documentation

template<typename T>
CSingleton< T >::CSingleton (  )  [inline, protected]

Definition at line 40 of file singleton.h.

00040 {}

template<typename T>
virtual CSingleton< T >::~CSingleton (  )  [inline, protected, virtual]

Definition at line 41 of file singleton.h.

00041 {}


Member Function Documentation

template<typename T>
void CSingleton< T >::_Kill (  )  [inline, private, virtual]

Implements CSingletonBase.

Definition at line 33 of file singleton.h.

00034         {
00035                 delete m_Instance;
00036                 m_Instance = NULL;
00037         }

template<typename T>
static T* CSingleton< T >::Instance (  )  [inline, static]

Definition at line 44 of file singleton.h.

00045         {
00046                 if( !m_Instance )
00047                 {
00048                         m_Instance = new T;
00049                         CSingletonManager::Add(m_Instance);
00050                 }
00051 
00052                 return m_Instance;
00053         }


Member Data Documentation

template<typename T>
T * CSingleton< T >::m_Instance = NULL [inline, static, private]

Definition at line 31 of file singleton.h.


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

Generated on Tue Aug 30 02:36:58 2011 for Smacky by  doxygen 1.5.8