From 6e73ca6ada8a41692809dae5db89c8db0675ce1e Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 17 Oct 2021 16:01:30 +0800 Subject: -Runner --- Runner/Utilities/Singleton.h | 45 -------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 Runner/Utilities/Singleton.h (limited to 'Runner/Utilities/Singleton.h') diff --git a/Runner/Utilities/Singleton.h b/Runner/Utilities/Singleton.h deleted file mode 100644 index 65c9e60..0000000 --- a/Runner/Utilities/Singleton.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef SINGLETON_H -#define SINGLETON_H - -template -class Singleton -{ -public: - - static T* Instance() - { - if (!instance) instance = new T; - return instance; - } - - static void Destroy() - { - delete instance; - instance = nullptr; - } - -protected: - - Singleton() - { - instance = static_cast(this); - }; - - virtual ~Singleton() {}; - - static T* instance; - -private: - - Singleton(const Singleton& singleton); - - Singleton& operator = (const Singleton& singleton); - -}; - -template -T* Singleton::instance = nullptr; - -#define Get(T) T::Instance() - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0