mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-28 14:05:41 +00:00
fix compile
This commit is contained in:
parent
8cbdf27228
commit
b67a087448
2 changed files with 22 additions and 19 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
// TODO - implement
|
// TODO - implement
|
||||||
|
|
||||||
|
template<>
|
||||||
cCustomSoundTrack* base::cSingleton<cCustomSoundTrack>::mspInstance = nil;
|
cCustomSoundTrack* base::cSingleton<cCustomSoundTrack>::mspInstance = nil;
|
||||||
|
|
||||||
cCustomSoundTrack::cCustomSoundTrack() :
|
cCustomSoundTrack::cCustomSoundTrack() :
|
||||||
|
|
|
@ -5,6 +5,26 @@
|
||||||
namespace base
|
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
|
class cSingletonBase
|
||||||
{
|
{
|
||||||
friend class cSingletonManager;
|
friend class cSingletonManager;
|
||||||
|
@ -19,7 +39,7 @@ template<typename T>
|
||||||
class cSingleton : public cSingletonBase
|
class cSingleton : public cSingletonBase
|
||||||
{
|
{
|
||||||
static T* mspInstance;
|
static T* mspInstance;
|
||||||
static void cSingleton<T>::CreateInstance()
|
static void CreateInstance()
|
||||||
{
|
{
|
||||||
mspInstance = new T();
|
mspInstance = new T();
|
||||||
SingletonManager().Add(mspInstance);
|
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();
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue