From ca3327dbed76d7d13b9e2754990b717267700be9 Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 22 Jun 2014 15:45:54 +0200 Subject: Replaced ACE_Configuration_Heap based config file handling with boost::property_tree::ini_parser --- src/server/shared/Configuration/Config.h | 35 +++++++++----------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'src/server/shared/Configuration/Config.h') diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index 4693b21a0c7..d05a083d166 100644 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -21,18 +21,11 @@ #include #include -#include -#include -#include -#include - -typedef Trinity::AutoPtr Config; +#include +#include class ConfigMgr { - friend class ACE_Singleton; - friend class ConfigLoader; - ConfigMgr() { } ~ConfigMgr() { } @@ -40,13 +33,11 @@ public: /// Method used only for loading main configuration files (authserver.conf and worldserver.conf) bool LoadInitial(char const* file); - /** - * This method loads additional configuration files - * It is recommended to use this method in WorldScript::OnConfigLoad hooks - * - * @return true if loading was successful - */ - bool LoadMore(char const* file); + static ConfigMgr* instance() + { + static ConfigMgr *instance = new ConfigMgr(); + return instance; + } bool Reload(); @@ -59,20 +50,14 @@ public: std::list GetKeysByString(std::string const& name); private: - bool GetValueHelper(const char* name, ACE_TString &result); - bool LoadData(char const* file); - - typedef ACE_Thread_Mutex LockType; - typedef ACE_Guard GuardType; - std::string _filename; - Config _config; - LockType _configLock; + boost::property_tree::ptree _config; + std::mutex _configLock; ConfigMgr(ConfigMgr const&); ConfigMgr& operator=(ConfigMgr const&); }; -#define sConfigMgr ACE_Singleton::instance() +#define sConfigMgr ConfigMgr::instance() #endif -- cgit v1.2.3