#include <SingletonHolder.h>
Public Member Functions | |
S * | get () |
SingletonHolder () | |
Creates the SingletonHolder. | |
~SingletonHolder () | |
Private Attributes | |
FastMutex | _m |
S * | _pS |
This is a helper template class for managing singleton objects allocated on the heap. The class ensures proper deletion (including calling of the destructor) of singleton objects when the application that created them terminates.
Definition at line 51 of file SingletonHolder.h.
Poco::SingletonHolder< S >::SingletonHolder | ( | ) | [inline] |
Creates the SingletonHolder.
Definition at line 59 of file SingletonHolder.h.
Poco::SingletonHolder< S >::~SingletonHolder | ( | ) | [inline] |
Destroys the SingletonHolder and the singleton object that it holds.
Definition at line 64 of file SingletonHolder.h.
S* Poco::SingletonHolder< S >::get | ( | ) | [inline] |
Returns a pointer to the singleton object hold by the SingletonHolder. The first call to get will create the singleton.
Definition at line 70 of file SingletonHolder.h.
FastMutex Poco::SingletonHolder< S >::_m [private] |
Definition at line 82 of file SingletonHolder.h.
S* Poco::SingletonHolder< S >::_pS [private] |
Definition at line 81 of file SingletonHolder.h.