SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
Template class used to make from a class a singleton. More...
#include <threadsafesingleton.h>
Static Public Member Functions | |
static S & | instance () |
Protected Member Functions | |
ThreadSafeSingleton () | |
~ThreadSafeSingleton () | |
Static Protected Attributes | |
static S * | _pInstance = new S |
Private Member Functions | |
ThreadSafeSingleton (const ThreadSafeSingleton &) | |
ThreadSafeSingleton & | operator= (const ThreadSafeSingleton &) |
Template class used to make from a class a singleton.
S is the type of the singleton object to instantiate.
This class permits to gather all singleton code in the same place and not to pollute object interface with singleton methods.
Accessing to the instance of S is made through ThreadSafeSingleton<S>::instance()
Note : The class using this adapter should have constructor and destructor protected and copy constructor and operator= private.
Besides it should declare the class ThreadSafeSingleton<S> friend in order this class can make the construction.
Definition at line 22 of file threadsafesingleton.h.
|
inlineprotected |
Definition at line 28 of file threadsafesingleton.h.
|
inlineprotected |
Definition at line 29 of file threadsafesingleton.h.
References ThreadSafeSingleton< S >::_pInstance.
|
inlineprivate |
Definition at line 33 of file threadsafesingleton.h.
|
inlinestatic |
Definition at line 25 of file threadsafesingleton.h.
References ThreadSafeSingleton< S >::_pInstance.
|
inlineprivate |
Definition at line 34 of file threadsafesingleton.h.
|
staticprotected |
Definition at line 30 of file threadsafesingleton.h.
Referenced by ThreadSafeSingleton< S >::instance(), and ThreadSafeSingleton< S >::~ThreadSafeSingleton().