22 #ifndef COMMON_SINGLETON_H 23 #define COMMON_SINGLETON_H 25 #include "common/noncopyable.h" 59 static T *makeInstance() {
63 static void destroyInstance() {
70 static bool hasInstance() {
71 return _singleton != 0;
74 static T& instance() {
83 _singleton = T::makeInstance();
87 static void destroy() {
94 typedef T SingletonBaseType;
105 #define DECLARE_SINGLETON(T) \ 106 template<> T *Singleton<T>::_singleton = 0 Definition: noncopyable.h:39
Definition: algorithm.h:29
Definition: singleton.h:42