wirelessgateway/utility/SH_MySingleton.hpp

24 lines
370 B
C++
Raw Normal View History

2021-09-18 13:45:24 +08:00
#ifndef MYSINGLETON_H_
#define MYSINGLETON_H_
template<class T>
class MySingleton {
public:
static T* instance() {
static T _instance;
return &_instance;
}
;
protected:
MySingleton() {
}
;
virtual ~MySingleton() {
}
;
MySingleton(const MySingleton &);
MySingleton& operator=(const MySingleton &);
};
#endif