 |
Sayonara Player
|
22 #ifndef SAYONARA_SINGLETON_H 23 #define SAYONARA_SINGLETON_H 25 #define _SINGLETON_BASIC_(class_name) friend class Application; \ 27 class_name( const class_name& other ) = delete; \ 28 class_name& operator=(const class_name& other) = delete; \ 29 class_name( const class_name&& other ) = delete; \ 30 class_name& operator=(const class_name&& other) = delete; \ 32 static class_name *instance() \ 33 { static class_name instance; return &instance; } \ 34 virtual ~class_name (); 36 #define SINGLETON(class_name) _SINGLETON_BASIC_(class_name) \ 41 #define SINGLETON_QOBJECT(class_name) _SINGLETON_BASIC_(class_name) \ 43 class_name(QObject* parent=nullptr); \ 47 #endif // SAYONARA_SINGLETON_H