mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
feat(Core/Misc): remove and replace ACE_Singleton (#2418)
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
#include "Errors.h"
|
||||
#include "Log.h"
|
||||
|
||||
ConfigMgr* ConfigMgr::instance()
|
||||
{
|
||||
static ConfigMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
// Defined here as it must not be exposed to end-users.
|
||||
bool ConfigMgr::GetValueHelper(const char* name, ACE_TString &result)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <ace/Singleton.h>
|
||||
#include <ace/Configuration_Import_Export.h>
|
||||
#include <ace/Thread_Mutex.h>
|
||||
#include <AutoPtr.h>
|
||||
@@ -19,13 +18,12 @@ typedef acore::AutoPtr<ACE_Configuration_Heap, ACE_Null_Mutex> Config;
|
||||
|
||||
class ConfigMgr
|
||||
{
|
||||
friend class ACE_Singleton<ConfigMgr, ACE_Null_Mutex>;
|
||||
friend class ConfigLoader;
|
||||
|
||||
ConfigMgr() { }
|
||||
~ConfigMgr() { }
|
||||
|
||||
public:
|
||||
|
||||
static ConfigMgr* instance();
|
||||
|
||||
/// Method used only for loading main configuration files (authserver.conf and worldserver.conf)
|
||||
bool LoadInitial(char const* file);
|
||||
|
||||
@@ -62,10 +60,12 @@ private:
|
||||
Config _config;
|
||||
LockType _configLock;
|
||||
|
||||
ConfigMgr(ConfigMgr const&);
|
||||
ConfigMgr& operator=(ConfigMgr const&);
|
||||
ConfigMgr() = default;
|
||||
ConfigMgr(ConfigMgr const&) = delete;
|
||||
ConfigMgr& operator=(ConfigMgr const&) = delete;
|
||||
~ConfigMgr() = default;
|
||||
};
|
||||
|
||||
#define sConfigMgr ACE_Singleton<ConfigMgr, ACE_Null_Mutex>::instance()
|
||||
#define sConfigMgr ConfigMgr::instance()
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user