#ifndef SINGLETON_H #define SINGLETON_H /** * @brief The Singleton class */ template class Singleton { public: static T* getInstance(); }; template T* Singleton::getInstance() { static T* instance = new T(); return instance; } #define SINGLETON(Class) \ private: \ friend class Singleton; \ public: \ static Class* getInstance() { \ return Singleton::getInstance(); \ } #endif // SINGLETON_H