ASSA::Singleton< T > Class Template Reference

#include <Singleton.h>

Inheritance diagram for ASSA::Singleton< T >:

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

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static T * get_instance ()
 Return an instance of templated class T.

Protected Member Functions

 Singleton ()
 Protected Constructor.
virtual ~Singleton ()
 Virtual Destructor.

Static Private Attributes

static T * m_instance
 Pointer to the object T instance.
static Destroyer< T > m_destroyer
 Destroyer that owns object T.

Friends

class Destroyer< T >

Detailed Description

template<class T>
class ASSA::Singleton< T >

Definition at line 42 of file Singleton.h.


Constructor & Destructor Documentation

template<class T>
ASSA::Singleton< T >::Singleton  )  [inline, protected]
 

Protected Constructor.

Definition at line 57 of file Singleton.h.

00057 {}

template<class T>
virtual ASSA::Singleton< T >::~Singleton  )  [inline, protected, virtual]
 

Virtual Destructor.

Definition at line 62 of file Singleton.h.

00062 {}


Member Function Documentation

template<class T>
static T* ASSA::Singleton< T >::get_instance  )  [inline, static]
 

Return an instance of templated class T.

Definition at line 47 of file Singleton.h.

00047                               {
00048         if (m_instance == 0) {
00049             m_instance = new T;
00050             m_destroyer.setGuard (m_instance);
00051         }
00052         return m_instance;
00053     }


Friends And Related Function Documentation

template<class T>
friend class Destroyer< T > [friend]
 

Definition at line 59 of file Singleton.h.


Member Data Documentation

template<class T>
Destroyer<T> ASSA::Singleton< T >::m_destroyer [static, private]
 

Destroyer that owns object T.

Definition at line 69 of file Singleton.h.

Referenced by ASSA::Singleton< Logger >::get_instance().

template<class T>
T* ASSA::Singleton< T >::m_instance [static, private]
 

Pointer to the object T instance.

Definition at line 66 of file Singleton.h.

Referenced by ASSA::Singleton< Logger >::get_instance().


The documentation for this class was generated from the following file:
Generated on Sun Aug 13 15:08:21 2006 for libassa by  doxygen 1.4.6