00001 #ifndef XCLONE_SINGLETON_H 00002 #define XCLONE_SINGLETON_H 00003 00004 template <class T> 00005 class Singleton 00006 { 00007 public: 00008 static T& instance() 00009 { 00010 static T instance; 00011 return instance; 00012 } 00013 00014 protected: 00015 Singleton() {} 00016 00017 private: 00018 Singleton(Singleton& copy); 00019 }; 00020 00021 #endif