feat(Core/Misc): remove and replace ACE_Singleton (#2418)

This commit is contained in:
Kargatum
2019-12-21 00:29:29 +07:00
committed by GitHub
parent 16b45bf334
commit 4a8f1de538
88 changed files with 486 additions and 250 deletions

View File

@@ -17,6 +17,12 @@ PetitionMgr::~PetitionMgr()
{
}
PetitionMgr* PetitionMgr::instance()
{
static PetitionMgr instance;
return &instance;
}
void PetitionMgr::LoadPetitions()
{
uint32 oldMSTime = getMSTime();

View File

@@ -6,7 +6,7 @@ Xinef
#define _PETITIONMGR_H
#include "Common.h"
#include <ace/Singleton.h>
#include <map>
typedef std::map<uint32, uint32> SignatureMap;
@@ -29,13 +29,13 @@ typedef std::map<uint32, Petition> PetitionContainer;
class PetitionMgr
{
friend class ACE_Singleton<PetitionMgr, ACE_Thread_Mutex>;
private:
PetitionMgr();
~PetitionMgr();
public:
static PetitionMgr* instance();
void LoadPetitions();
void LoadSignatures();
@@ -59,5 +59,6 @@ class PetitionMgr
SignatureContainer SignatureStore;
};
#define sPetitionMgr ACE_Singleton<PetitionMgr, ACE_Thread_Mutex>::instance()
#define sPetitionMgr PetitionMgr::instance()
#endif