From b67a08744849c2d0912ac818de92b752ee563e19 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 30 Aug 2021 10:58:57 +0300 Subject: [PATCH] fix compile --- src/leeds/CustomSoundTrack.cpp | 1 + src/leeds/base/singletonManager.h | 40 ++++++++++++++++--------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/leeds/CustomSoundTrack.cpp b/src/leeds/CustomSoundTrack.cpp index bcbfb82f..a71a66cc 100644 --- a/src/leeds/CustomSoundTrack.cpp +++ b/src/leeds/CustomSoundTrack.cpp @@ -4,6 +4,7 @@ // TODO - implement +template<> cCustomSoundTrack* base::cSingleton::mspInstance = nil; cCustomSoundTrack::cCustomSoundTrack() : diff --git a/src/leeds/base/singletonManager.h b/src/leeds/base/singletonManager.h index 833e178b..9c980bb2 100644 --- a/src/leeds/base/singletonManager.h +++ b/src/leeds/base/singletonManager.h @@ -5,6 +5,26 @@ namespace base { +class cSingletonBase; + +class cSingletonManager +{ + cSingletonBase* head; + cSingletonBase* tail; + +public: + cSingletonManager() : + head(nil), + tail(nil) + {} + + void Add(cSingletonBase*); + void Purge(); + ~cSingletonManager(); +}; + +cSingletonManager& SingletonManager(); + class cSingletonBase { friend class cSingletonManager; @@ -19,7 +39,7 @@ template class cSingleton : public cSingletonBase { static T* mspInstance; - static void cSingleton::CreateInstance() + static void CreateInstance() { mspInstance = new T(); SingletonManager().Add(mspInstance); @@ -39,22 +59,4 @@ public: } }; -class cSingletonManager -{ - cSingletonBase* head; - cSingletonBase* tail; - -public: - cSingletonManager() : - head(nil), - tail(nil) - {} - - void Add(cSingletonBase*); - void Purge(); - ~cSingletonManager(); -}; - -cSingletonManager& SingletonManager(); - } \ No newline at end of file