GUI::Singleton< T > Class Template Reference

Implement singleton design pattern with template. More...

#include <Singleton.h>

Inheritance diagram for GUI::Singleton< T >:

GUI::Application GUI::EventsDispatcher GUI::MessageTranslator GUI::WidgetFactory List of all members.

Static Public Member Functions

static T * getInstance ()
 Return the single instance of class T.

Protected Member Functions

 Singleton ()
 Constructor is protected for avoid new instance.
 Singleton (const Singleton &rhs)
 Copy-constructor is protected for avoid new instance.
 ~Singleton ()
 Destructor is protected for avoid new instance.
Singletonoperator= (const Singleton &rhs)
 Assignment operator is protected for avoid new instance.

Detailed Description

template<class T>
class GUI::Singleton< T >

Implement singleton design pattern with template.

Derived class must declare friend this class, because this class create the new instance and derived class must have private constructor and destructor.

Parameters:
T class that require single instance


Member Function Documentation

template<class T>
static T* GUI::Singleton< T >::getInstance (  )  [inline, static]

Return the single instance of class T.

Returns:
the single instance


The documentation for this class was generated from the following file:
Generated on Wed Nov 15 22:21:10 2006 for Win32 by  doxygen 1.4.7