m2etis  0.4
m2etis::util::Singleton< T > Class Template Reference

Derive from this templated class to make a class a singleton. Refer to the Singleton Design Pattern if it is not clear what a singleton is. Declare the ctor private. More...

#include <Singleton.h>

Static Public Member Functions

static T * GetSingletonPtr ()
 
static T & GetSingleton ()
 

Protected Member Functions

 Singleton ()
 
virtual ~Singleton ()
 

Static Protected Attributes

static T * _ptrSingleton
 
static boost::mutex _objMutex
 

Detailed Description

template<typename T>
class m2etis::util::Singleton< T >

Derive from this templated class to make a class a singleton. Refer to the Singleton Design Pattern if it is not clear what a singleton is. Declare the ctor private.

Definition at line 40 of file Singleton.h.

Constructor & Destructor Documentation

template<typename T >
m2etis::util::Singleton< T >::Singleton ( )
inlineprotected

Definition at line 55 of file Singleton.h.

template<typename T >
virtual m2etis::util::Singleton< T >::~Singleton ( )
inlineprotectedvirtual

Definition at line 56 of file Singleton.h.

Member Function Documentation

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

Definition at line 48 of file Singleton.h.

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

Definition at line 42 of file Singleton.h.

Member Data Documentation

template<typename T >
boost::mutex m2etis::util::Singleton< T >::_objMutex
staticprotected

Definition at line 64 of file Singleton.h.

template<typename T >
T * m2etis::util::Singleton< T >::_ptrSingleton
staticprotected

Definition at line 63 of file Singleton.h.


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