RSC
0.17.1
|
This template class implements the singleton pattern. More...
#include <Singleton.h>
Public Member Functions | |
virtual | ~Singleton () |
Static Public Member Functions | |
static T & | getInstance () |
Retrieve the singleton instance, creating it if necessary. More... | |
static void | killInstance () |
This function can be used to make sure the instance is deleted at a particular time. More... | |
Static Private Member Functions | |
static boost::shared_ptr< T > & | getStorage () |
static boost::mutex & | getInstanceMutex () |
static void | createMutex (boost::mutex *&destination) |
This template class implements the singleton pattern.
To add singleton behavior to a class T
, add Singleton<T>
to its list of base classes.
Singleton<T>
. Definition at line 51 of file Singleton.h.
|
virtual |
Definition at line 113 of file Singleton.h.
|
staticprivate |
Definition at line 85 of file Singleton.h.
Referenced by rsc::patterns::Singleton< T >::getInstanceMutex().
|
static |
Retrieve the singleton instance, creating it if necessary.
Definition at line 99 of file Singleton.h.
References rsc::patterns::Singleton< T >::getInstanceMutex(), and rsc::patterns::Singleton< T >::getStorage().
|
staticprivate |
Definition at line 90 of file Singleton.h.
References rsc::patterns::Singleton< T >::createMutex().
Referenced by rsc::patterns::Singleton< T >::getInstance(), and rsc::patterns::Singleton< T >::killInstance().
|
staticprivate |
Definition at line 129 of file Singleton.h.
Referenced by rsc::patterns::Singleton< T >::getInstance(), and rsc::patterns::Singleton< T >::killInstance().
|
static |
This function can be used to make sure the instance is deleted at a particular time.
You may need this function to enforce a certain order of destruction.
Definition at line 117 of file Singleton.h.
References rsc::patterns::Singleton< T >::getInstanceMutex(), and rsc::patterns::Singleton< T >::getStorage().