 |
Sayonara Player
|
22 #ifndef SAYONARA_SINGLETON_H 23 #define SAYONARA_SINGLETON_H 25 #define _SINGLETON_BASIC_(class_name) protected: \ 26 class_name( const class_name& other ) = delete; \ 27 class_name& operator=(const class_name& other) = delete; \ 28 class_name( const class_name&& other ) = delete; \ 29 class_name& operator=(const class_name&& other) = delete; \ 31 static class_name *getInstance() \ 32 { static class_name instance; return &instance; } \ 33 virtual ~class_name (); 35 #define SINGLETON(class_name) _SINGLETON_BASIC_(class_name) \ 40 #define SINGLETON_QOBJECT(class_name) _SINGLETON_BASIC_(class_name) \ 42 class_name(QObject* parent=nullptr); \ 46 #endif // SAYONARA_SINGLETON_H