CARMA C++
|
Singleton creation policy which causes instances to be allocated with new (on the heap) but which provides no deletion of memory. More...
#include <carma/util/Singleton.h>
Static Public Member Functions | |
static TYPE * | createInstance () |
static void | deleteInstance (TYPE *ptr) |
Singleton creation policy which causes instances to be allocated with new (on the heap) but which provides no deletion of memory.
With this creation policy, the user is completely responsible for making sure that the instance is destroyed. Here is an example which uses an auto_ptr to delete the instance when the auto_ptr goes out of scope:
In general this is a pretty dangerous policy simply because it allows for instances to more easily be deleted out from under one's feet. However, if created in the manner above, any access to Automanaged::instance() following destruction of the instance will result in a std::logic_error exception being thrown.
Definition at line 192 of file Singleton.h.