Public Member Functions | Static Public Member Functions | Static Private Attributes
WeakSingleton< T > Class Template Reference

Singleton design pattern: only one instance is allowed. More...

#include <Singleton.h>

Public Member Functions

 WeakSingleton (T *obj)
 Constructor. More...

Static Public Member Functions

static T * instance ()
 Retrieve the instance. More...

Static Private Attributes

static T * m_instance = 0
 One and only instance. More...

Detailed Description

template<class T>
class WeakSingleton< T >

Singleton design pattern: only one instance is allowed.

The WeakSingleton follows weaker rules than the StrictSingleton:

Definition at line 69 of file Singleton.h.

Constructor & Destructor Documentation

◆ WeakSingleton()

template<class T >
WeakSingleton< T >::WeakSingleton ( T *  obj)


objNew instance of T.

Definition at line 78 of file Singleton.h.

Member Function Documentation

◆ instance()

template<class T >
static T* WeakSingleton< T >::instance ( )

Retrieve the instance.

Definition at line 86 of file Singleton.h.

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