GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SingletonDestroyer< Data_T > Class Template Reference

To properly destroy a singleton. More...

#include <SingletonDestroyer.h>

Inheritance diagram for SingletonDestroyer< Data_T >:

Public Member Functions

void SetSingleton (Data_T *t)
 
 SingletonDestroyer (Data_T *t=0x0)
 
virtual ~SingletonDestroyer ()
 

Detailed Description

template<typename Data_T>
class SingletonDestroyer< Data_T >

To properly destroy a singleton.

The way it works is the following : Add to your class a

static SingletonDestroyer<MyType> gTheSingletonDestroyer;

(not a pointer but a real object !) Once the pointer of the singleton is created, pass it to the destroyer using SetSingleton

Once the program is finished, the destructo of the destroyer is called. This one delete the singleton

Definition at line 41 of file SingletonDestroyer.h.


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