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.
threadsafesingleton.h
Go to the documentation of this file.
1 /*
2  * threadsafesingleton.h
3  *
4  * Created on: Aug 7, 2015
5  * Author: f4exb
6  */
7 
8 #ifndef INCLUDE_UTIL_THREADSAFESINGLETON_H_
9 #define INCLUDE_UTIL_THREADSAFESINGLETON_H_
10 
12 
22 template <class S> class ThreadSafeSingleton
23 {
24 public:
25  static S& instance() { return *_pInstance; }
26 
27 protected:
30  static S* _pInstance;
31 
32 private:
35 };
36 
37 template <class S> S *ThreadSafeSingleton<S>::_pInstance = new S;
38 
39 #endif /* INCLUDE_UTIL_THREADSAFESINGLETON_H_ */
ThreadSafeSingleton(const ThreadSafeSingleton &)
Template class used to make from a class a singleton.
ThreadSafeSingleton & operator=(const ThreadSafeSingleton &)