diff options
| author | leak <leak@bitmx.net> | 2014-05-31 15:58:59 +0200 |
|---|---|---|
| committer | leak <leak@bitmx.net> | 2014-05-31 15:58:59 +0200 |
| commit | bf6e58b8d44d3a4b78e9473df029caac74c68220 (patch) | |
| tree | 44f513a9bc96e04a997ce98dfb2249436f2c37e3 /src/server/authserver/Realms | |
| parent | f05d5406585fe2d69796b93bff73a21e1cd41a23 (diff) | |
Ditched ACE_Singleton in favor of C++11 like Singleton
Diffstat (limited to 'src/server/authserver/Realms')
| -rw-r--r-- | src/server/authserver/Realms/RealmList.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 88da30ea963..29b6aca07d3 100644 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -19,8 +19,6 @@ #ifndef _REALMLIST_H #define _REALMLIST_H -#include <ace/Singleton.h> -#include <ace/Null_Mutex.h> #include <ace/INET_Addr.h> #include "Common.h" @@ -59,8 +57,11 @@ class RealmList public: typedef std::map<std::string, Realm> RealmMap; - RealmList(); - ~RealmList() { } + static RealmList& instance() + { + static RealmList *instance = new RealmList(); + return *instance; + } void Initialize(uint32 updateInterval); @@ -73,13 +74,16 @@ public: uint32 size() const { return m_realms.size(); } private: + RealmList(); + void UpdateRealms(bool init = false); - void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, + uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; time_t m_NextUpdateTime; }; -#define sRealmList ACE_Singleton<RealmList, ACE_Null_Mutex>::instance() +#define sRealmList RealmList::instance() #endif |
