![]() |
Vault
4.1
|
This template class allows you to easily register a singleton class T with the shutdown registry, so that it will get cleaned up at shutdown. More...
#include <vshutdownregistry.h>
Public Member Functions | |
| VSingletonShutdownHandler (bool deleteHandlerAfterShutdown=true) | |
| Constructs the handler. | |
Protected Member Functions | |
| virtual void | _shutdown () |
| Implementation of IVShutdownHandler interface. | |
This template class allows you to easily register a singleton class T with the shutdown registry, so that it will get cleaned up at shutdown.
The requirements for the class T are simple:
static void deleteInstance(); gInstance = new MyClass(params); new VSingletonShutdownHandler<MyClass>(); Definition at line 139 of file vshutdownregistry.h.
| VSingletonShutdownHandler< T >::VSingletonShutdownHandler | ( | bool | deleteHandlerAfterShutdown = true | ) | [inline] |
Constructs the handler.
| deleteHandlerAfterShutdown | true if the handler (not the T instance) can be deleted after _shutdown() is called; this is true for heap objects, false for global variables |
Definition at line 148 of file vshutdownregistry.h.
References VShutdownRegistry::instance(), and VShutdownRegistry::registerHandler().
| virtual void VSingletonShutdownHandler< T >::_shutdown | ( | ) | [inline, protected, virtual] |
Implementation of IVShutdownHandler interface.
To shut down the singleton means to delete the instance.
Implements IVShutdownHandler.
Definition at line 162 of file vshutdownregistry.h.