File indexing completed on 2025-01-18 09:52:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_SINGLETON_MJM012402_HPP
0011 #define BOOST_SINGLETON_MJM012402_HPP
0012
0013 #include <boost/thread/detail/config.hpp>
0014
0015 namespace boost {
0016 namespace detail {
0017 namespace thread {
0018
0019
0020
0021
0022 template <class T>
0023 class singleton : private T
0024 {
0025 private:
0026 singleton();
0027 ~singleton();
0028
0029 public:
0030 static T &instance();
0031 };
0032
0033
0034 template <class T>
0035 inline singleton<T>::singleton()
0036 {
0037
0038 }
0039
0040 template <class T>
0041 inline singleton<T>::~singleton()
0042 {
0043
0044 }
0045
0046 template <class T>
0047 T &singleton<T>::instance()
0048 {
0049
0050
0051 static singleton<T> s_oT;
0052 return(s_oT);
0053 }
0054
0055 }
0056 }
0057 }
0058
0059 #endif