PWToolBox::Singleton< T > Class Template Reference

A base class for singletons. More...

#include <Singleton.h>

List of all members.

Public Member Functions

 Singleton ()
 The constructor will throw an exception if an object of type T already exists.
virtual ~Singleton ()
 Clears the value of the static singleton pointer so another object of type T can be created.

Static Public Member Functions

static T & getSingleton ()
static T * getSingletonPtr ()


Detailed Description

template<typename T>
class PWToolBox::Singleton< T >

A base class for singletons.

When using this class, the deriving class should specify itself as the template parameter.


Constructor & Destructor Documentation

template<typename T>
PWToolBox::Singleton< T >::Singleton (  )  [inline]

The constructor will throw an exception if an object of type T already exists.

Exceptions:
SingletonException Thrown when an object of type T already exists

template<typename T>
virtual PWToolBox::Singleton< T >::~Singleton (  )  [inline, virtual]

Clears the value of the static singleton pointer so another object of type T can be created.


Member Function Documentation

template<typename T>
static T& PWToolBox::Singleton< T >::getSingleton (  )  [inline, static]

Returns:
Returns a reference to the singleton object

template<typename T>
static T* PWToolBox::Singleton< T >::getSingletonPtr (  )  [inline, static]

Returns:
Returns a pointer to the singleton object


The documentation for this class was generated from the following file:
Generated on Sun Jul 13 14:18:26 2008 for PWToolBox by  doxygen 1.5.1