Refactor(Core/Misc): Remove remaining COMPILER_HAS_CPP11_SUPPORT related macros (#1627)

* Delete macros UNORDERED_MAP
* Delete macros UNORDERED_SET
This commit is contained in:
Kargatum
2019-03-26 00:01:56 +07:00
committed by GitHub
parent d1abe39414
commit 824a80005c
57 changed files with 175 additions and 408 deletions

View File

@@ -8,11 +8,11 @@
#define _MMAP_FACTORY_H
#include "MMapManager.h"
#include "UnorderedMap.h"
#include "DetourAlloc.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
#include "Map.h"
#include <unordered_map>
namespace MMAP
{

View File

@@ -7,11 +7,11 @@
#ifndef _MMAP_MANAGER_H
#define _MMAP_MANAGER_H
#include "UnorderedMap.h"
#include "DetourAlloc.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
#include "World.h"
#include <unordered_map>
// memory management
inline void* dtCustomAlloc(size_t size, dtAllocHint /*hint*/)
@@ -27,8 +27,8 @@ inline void dtCustomFree(void* ptr)
// move map related classes
namespace MMAP
{
typedef UNORDERED_MAP<uint32, dtTileRef> MMapTileSet;
typedef UNORDERED_MAP<uint32, dtNavMeshQuery*> NavMeshQuerySet;
typedef std::unordered_map<uint32, dtTileRef> MMapTileSet;
typedef std::unordered_map<uint32, dtNavMeshQuery*> NavMeshQuerySet;
// dummy struct to hold map's mmap data
struct MMapData
@@ -51,7 +51,7 @@ namespace MMAP
};
typedef UNORDERED_MAP<uint32, MMapData*> MMapDataSet;
typedef std::unordered_map<uint32, MMapData*> MMapDataSet;
// singleton class
// holds all all access to mmap loading unloading and meshes

View File

@@ -19,9 +19,9 @@
#define _VMAPMANAGER2_H
#include "IVMapManager.h"
#include "Dynamic/UnorderedMap.h"
#include "Define.h"
#include <ace/Thread_Mutex.h>
#include <unordered_map>
//===========================================================
@@ -62,8 +62,8 @@ namespace VMAP
int iRefCount;
};
typedef UNORDERED_MAP<uint32, StaticMapTree*> InstanceTreeMap;
typedef UNORDERED_MAP<std::string, ManagedModel> ModelFileMap;
typedef std::unordered_map<uint32, StaticMapTree*> InstanceTreeMap;
typedef std::unordered_map<std::string, ManagedModel> ModelFileMap;
class VMapManager2 : public IVMapManager
{

View File

@@ -8,8 +8,8 @@
#define _MAPTREE_H
#include "Define.h"
#include "Dynamic/UnorderedMap.h"
#include "BoundingIntervalHierarchy.h"
#include <unordered_map>
namespace VMAP
{
@@ -27,8 +27,8 @@ namespace VMAP
class StaticMapTree
{
typedef UNORDERED_MAP<uint32, bool> loadedTileMap;
typedef UNORDERED_MAP<uint32, uint32> loadedSpawnMap;
typedef std::unordered_map<uint32, bool> loadedTileMap;
typedef std::unordered_map<uint32, uint32> loadedSpawnMap;
private:
uint32 iMapID;
bool iIsTiled;

View File

@@ -31,7 +31,7 @@ struct GameobjectModelData
std::string name;
};
typedef UNORDERED_MAP<uint32, GameobjectModelData> ModelList;
typedef std::unordered_map<uint32, GameobjectModelData> ModelList;
ModelList model_list;
void LoadGameObjectModelList()

View File

@@ -49,8 +49,8 @@
#include "Define.h"
#include "Dynamic/UnorderedMap.h"
#include "Dynamic/UnorderedSet.h"
#include <unordered_map>
#include <unordered_set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -43,12 +43,4 @@
# error "FATAL ERROR: Unknown compiler."
#endif
#if defined(__cplusplus) && __cplusplus == 201103L
# define COMPILER_HAS_CPP11_SUPPORT 1
#elif _MSC_VER >= 1700
# define COMPILER_HAS_CPP11_SUPPORT 1
#else
# define COMPILER_HAS_CPP11_SUPPORT 0
#endif
#endif

View File

@@ -1,107 +0,0 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#ifndef TRINITY_HASH_NAMESPACE_H
#define TRINITY_HASH_NAMESPACE_H
#include "Define.h"
#if COMPILER_HAS_CPP11_SUPPORT
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#elif defined(_STLPORT_VERSION)
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
# define HASH_NAMESPACE_START namespace std { namespace tr1 {
# define HASH_NAMESPACE_END } }
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
# define HASH_NAMESPACE_START namespace stdext {
# define HASH_NAMESPACE_END }
#if !_HAS_TRADITIONAL_STL
#ifndef HASH_NAMESPACE
#define HASH_NAMESPACE
#else
// can be not used by some platforms, so provide fake forward
HASH_NAMESPACE_START
template<class K>
class hash
{
public:
size_t operator() (K const&);
};
HASH_NAMESPACE_END
#endif
#endif
#elif COMPILER == COMPILER_INTEL
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
# define HASH_NAMESPACE_START namespace std { namespace tr1 {
# define HASH_NAMESPACE_END } }
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
# define HASH_NAMESPACE_START namespace __gnu_cxx {
# define HASH_NAMESPACE_END }
#include <ext/hash_fun.h>
#include <string>
HASH_NAMESPACE_START
template<>
class hash<unsigned long long>
{
public:
size_t operator()(const unsigned long long &__x) const { return (size_t)__x; }
};
template<typename T>
class hash<T *>
{
public:
size_t operator()(T * const &__x) const { return (size_t)__x; }
};
template<> struct hash<std::string>
{
size_t operator()(const std::string &__x) const
{
return hash<char const*>()(__x.c_str());
}
};
HASH_NAMESPACE_END
#else
# define HASH_NAMESPACE_START namespace std {
# define HASH_NAMESPACE_END }
#endif
#if COMPILER != COMPILER_MICROSOFT
// Visual Studio use non standard hash calculation function, so provide fake forward for other
HASH_NAMESPACE_START
template<class K>
size_t hash_value(K const&);
HASH_NAMESPACE_END
#endif
#endif

View File

@@ -8,12 +8,11 @@
#define TRINITY_OBJECTREGISTRY_H
#include "Define.h"
#include "Dynamic/UnorderedMap.h"
#include <ace/Singleton.h>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
/** ObjectRegistry holds all registry item of the same type
*/

View File

@@ -1,60 +0,0 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#ifndef TRINITY_UNORDERED_MAP_H
#define TRINITY_UNORDERED_MAP_H
#include "HashNamespace.h"
#if COMPILER_HAS_CPP11_SUPPORT
# include <unordered_map>
#elif COMPILER == COMPILER_INTEL
# include <ext/hash_map>
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
# include <unordered_map>
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
# include <tr1/unordered_map>
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
# include <ext/hash_map>
#elif COMPILER == COMPILER_MICROSOFT && ((_MSC_VER >= 1500 && _HAS_TR1) || _MSC_VER >= 1700) // VC9.0 SP1 and later
# include <unordered_map>
#else
# include <hash_map>
#endif
#ifdef _STLPORT_VERSION
# define UNORDERED_MAP std::hash_map
# define UNORDERED_MULTIMAP std::hash_multimap
#elif COMPILER_HAS_CPP11_SUPPORT
# define UNORDERED_MAP std::unordered_map
# define UNORDERED_MULTIMAP std::unordered_multimap
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
# define UNORDERED_MAP std::tr1::unordered_map
# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
# define UNORDERED_MAP std::tr1::unordered_map
# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
# define UNORDERED_MAP stdext::hash_map
# define UNORDERED_MULTIMAP stdext::hash_multimap
#elif COMPILER == COMPILER_INTEL
# define UNORDERED_MAP std::hash_map
# define UNORDERED_MULTIMAP std::hash_multimap
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
# define UNORDERED_MAP std::unordered_map
# define UNORDERED_MULTIMAP std::unordered_multimap
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
# define UNORDERED_MAP std::tr1::unordered_map
# define UNORDERED_MULTIMAP std::tr1::unordered_multimap
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
# define UNORDERED_MAP __gnu_cxx::hash_map
# define UNORDERED_MULTIMAP __gnu_cxx::hash_multimap
#else
# define UNORDERED_MAP std::hash_map
# define UNORDERED_MULTIMAP std::hash_multimap
#endif
#endif

View File

@@ -1,54 +0,0 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#ifndef TRINITY_UNORDERED_SET_H
#define TRINITY_UNORDERED_SET_H
#include "HashNamespace.h"
#if COMPILER_HAS_CPP11_SUPPORT
# include <unordered_set>
#elif COMPILER == COMPILER_INTEL
# include <ext/hash_set>
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
# include <unordered_set>
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
# include <tr1/unordered_set>
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
# include <ext/hash_set>
#elif COMPILER == COMPILER_MICROSOFT && ((_MSC_VER >= 1500 && _HAS_TR1) || _MSC_VER >= 1700) // VC9.0 SP1 and later
# include <unordered_set>
#else
# include <hash_set>
#endif
#ifdef _STLPORT_VERSION
# define UNORDERED_SET std::hash_set
using std::hash_set;
#elif COMPILER_HAS_CPP11_SUPPORT
# define UNORDERED_SET std::unordered_set
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1600 // VS100
# define UNORDERED_SET std::tr1::unordered_set
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1
# define UNORDERED_SET std::tr1::unordered_set
#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300
# define UNORDERED_SET stdext::hash_set
using stdext::hash_set;
#elif COMPILER == COMPILER_INTEL
# define UNORDERED_SET std::hash_set
using std::hash_set;
#elif COMPILER == COMPILER_GNU && defined(__clang__) && defined(_LIBCPP_VERSION)
# define UNORDERED_SET std::unordered_set
#elif COMPILER == COMPILER_GNU && GCC_VERSION > 40200
# define UNORDERED_SET std::tr1::unordered_set
#elif COMPILER == COMPILER_GNU && GCC_VERSION >= 30000
# define UNORDERED_SET __gnu_cxx::hash_set
#else
# define UNORDERED_SET std::hash_set
using std::hash_set;
#endif
#endif

View File

@@ -218,7 +218,7 @@ class SmartScript
void SetScript9(SmartScriptHolder& e, uint32 entry);
Unit* GetLastInvoker(Unit* invoker = NULL);
uint64 mLastInvoker;
typedef UNORDERED_MAP<uint32, uint32> CounterMap;
typedef std::unordered_map<uint32, uint32> CounterMap;
CounterMap mCounterList;
// Xinef: Fix Combat Movement
@@ -271,7 +271,7 @@ class SmartScript
SmartScriptType mScriptType;
uint32 mEventPhase;
UNORDERED_MAP<int32, int32> mStoredDecimals;
std::unordered_map<int32, int32> mStoredDecimals;
uint32 mPathId;
SmartAIEventStoredList mStoredEvents;
std::list<uint32> mRemIDs;

View File

@@ -24,7 +24,7 @@ void SmartWaypointMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
for (UNORDERED_MAP<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr)
for (std::unordered_map<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr)
{
for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr)
delete pathItr->second;
@@ -83,7 +83,7 @@ void SmartWaypointMgr::LoadFromDB()
SmartWaypointMgr::~SmartWaypointMgr()
{
for (UNORDERED_MAP<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr)
for (std::unordered_map<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr)
{
for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr)
delete pathItr->second;

View File

@@ -1564,7 +1564,7 @@ struct SmartScriptHolder
};
typedef UNORDERED_MAP<uint32, WayPoint*> WPPath;
typedef std::unordered_map<uint32, WayPoint*> WPPath;
typedef std::list<WorldObject*> ObjectList;
typedef std::list<uint64> GuidList;
@@ -1618,7 +1618,7 @@ public:
delete m_guidList;
}
};
typedef UNORDERED_MAP<uint32, ObjectGuidList*> ObjectListMap;
typedef std::unordered_map<uint32, ObjectGuidList*> ObjectListMap;
class SmartWaypointMgr
{
@@ -1637,7 +1637,7 @@ class SmartWaypointMgr
}
private:
UNORDERED_MAP<uint32, WPPath*> waypoint_map;
std::unordered_map<uint32, WPPath*> waypoint_map;
};
// all events for a single entry
@@ -1645,7 +1645,7 @@ typedef std::vector<SmartScriptHolder> SmartAIEventList;
typedef std::list<SmartScriptHolder> SmartAIEventStoredList;
// all events for all entries / guids
typedef UNORDERED_MAP<int32, SmartAIEventList> SmartAIEventMap;
typedef std::unordered_map<int32, SmartAIEventList> SmartAIEventMap;
class SmartAIMgr
{

View File

@@ -19,7 +19,7 @@
typedef std::list<AchievementCriteriaEntry const*> AchievementCriteriaEntryList;
typedef std::list<AchievementEntry const*> AchievementEntryList;
typedef UNORDERED_MAP<uint32, AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
typedef std::unordered_map<uint32, AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
typedef std::map<uint32, AchievementEntryList> AchievementListByReferencedId;
struct CriteriaProgress
@@ -244,8 +244,8 @@ struct CompletedAchievementData
bool changed;
};
typedef UNORDERED_MAP<uint32, CriteriaProgress> CriteriaProgressMap;
typedef UNORDERED_MAP<uint32, CompletedAchievementData> CompletedAchievementMap;
typedef std::unordered_map<uint32, CriteriaProgress> CriteriaProgressMap;
typedef std::unordered_map<uint32, CompletedAchievementData> CompletedAchievementMap;
class Unit;
class Player;
@@ -377,7 +377,7 @@ class AchievementGlobalMgr
// store achievements by referenced achievement id to speed up lookup
AchievementListByReferencedId m_AchievementListByReferencedId;
typedef UNORDERED_MAP<uint32 /*achievementId*/, std::chrono::system_clock::time_point /*completionTime*/> AllCompletedAchievements;
typedef std::unordered_map<uint32 /*achievementId*/, std::chrono::system_clock::time_point /*completionTime*/> AllCompletedAchievements;
AllCompletedAchievements m_allCompletedAchievements;
AchievementRewards m_achievementRewards;

View File

@@ -139,7 +139,7 @@ class AuctionHouseMgr
public:
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
typedef std::unordered_map<uint32, Item*> ItemMap;
AuctionHouseObject* GetAuctionsMap(uint32 factionTemplateId);
AuctionHouseObject* GetBidsMap(uint32 factionTemplateId);

View File

@@ -66,7 +66,7 @@ class Unit;
class Battlefield;
class BfGraveyard;
typedef UNORDERED_SET<uint64> GuidSet;
typedef std::unordered_set<uint64> GuidSet;
typedef std::vector<BfGraveyard*> GraveyardVect;
typedef std::map<uint64, time_t> PlayerTimerMap;

View File

@@ -16,7 +16,7 @@ class ArenaTeamMgr
~ArenaTeamMgr();
public:
typedef UNORDERED_MAP<uint32, ArenaTeam*> ArenaTeamContainer;
typedef std::unordered_map<uint32, ArenaTeam*> ArenaTeamContainer;
ArenaTeam* GetArenaTeamById(uint32 arenaTeamId) const;
ArenaTeam* GetArenaTeamByName(std::string const& arenaTeamName) const;

View File

@@ -16,7 +16,7 @@
#include <unordered_map>
typedef std::map<uint32, Battleground*> BattlegroundContainer;
typedef UNORDERED_MAP<uint32, BattlegroundTypeId> BattleMastersMap;
typedef std::unordered_map<uint32, BattlegroundTypeId> BattleMastersMap;
typedef Battleground*(*bgRef)(Battleground*);

View File

@@ -252,8 +252,8 @@ struct CalendarEvent
std::string _description;
};
typedef std::vector<CalendarInvite*> CalendarInviteStore;
typedef UNORDERED_SET<CalendarEvent*> CalendarEventStore;
typedef UNORDERED_MAP<uint64 /* eventId */, CalendarInviteStore > CalendarEventInviteStore;
typedef std::unordered_set<CalendarEvent*> CalendarEventStore;
typedef std::unordered_map<uint64 /* eventId */, CalendarInviteStore > CalendarEventInviteStore;
class CalendarMgr
{

View File

@@ -308,9 +308,9 @@ class Channel
}
}
typedef UNORDERED_MAP<uint64, PlayerInfo> PlayerContainer;
typedef UNORDERED_MAP<uint32, uint32> BannedContainer;
typedef UNORDERED_SET<Player*> PlayersWatchingContainer;
typedef std::unordered_map<uint64, PlayerInfo> PlayerContainer;
typedef std::unordered_map<uint32, uint32> BannedContainer;
typedef std::unordered_set<Player*> PlayersWatchingContainer;
bool _announce;
bool _ownership;

View File

@@ -19,7 +19,7 @@
class ChannelMgr
{
typedef UNORDERED_MAP<std::wstring, Channel*> ChannelMap;
typedef std::unordered_map<std::wstring, Channel*> ChannelMap;
typedef std::map<std::string, ChannelRights> ChannelRightsMap;
public:

View File

@@ -232,7 +232,7 @@ typedef std::map<uint64, LfgProposalPlayer> LfgProposalPlayerContainer;
typedef std::map<uint64, LfgPlayerBoot> LfgPlayerBootContainer;
typedef std::map<uint64, LfgGroupData> LfgGroupDataContainer;
typedef std::map<uint64, LfgPlayerData> LfgPlayerDataContainer;
typedef UNORDERED_MAP<uint32, LFGDungeonData> LFGDungeonContainer;
typedef std::unordered_map<uint32, LFGDungeonData> LFGDungeonContainer;
// Data needed by SMSG_LFG_JOIN_RESULT
struct LfgJoinResultData
@@ -386,15 +386,15 @@ class LFGMgr
~LFGMgr();
// pussywizard: RAIDBROWSER
typedef UNORDERED_MAP<uint32 /*playerGuidLow*/, RBEntryInfo> RBEntryInfoMap;
typedef UNORDERED_MAP<uint32 /*dungeonId*/, RBEntryInfoMap> RBStoreMap;
typedef std::unordered_map<uint32 /*playerGuidLow*/, RBEntryInfo> RBEntryInfoMap;
typedef std::unordered_map<uint32 /*dungeonId*/, RBEntryInfoMap> RBStoreMap;
RBStoreMap RaidBrowserStore[2]; // for 2 factions
typedef UNORDERED_MAP<uint32 /*playerGuidLow*/, uint32 /*dungeonId*/> RBSearchersMap;
typedef std::unordered_map<uint32 /*playerGuidLow*/, uint32 /*dungeonId*/> RBSearchersMap;
RBSearchersMap RBSearchersStore[2]; // for 2 factions
typedef UNORDERED_MAP<uint32 /*dungeonId*/, WorldPacket> RBCacheMap;
typedef std::unordered_map<uint32 /*dungeonId*/, WorldPacket> RBCacheMap;
RBCacheMap RBCacheStore[2]; // for 2 factions
typedef UNORDERED_MAP<uint32 /*guidLow*/, RBInternalInfo> RBInternalInfoMap;
typedef UNORDERED_MAP<uint32 /*dungeonId*/, RBInternalInfoMap> RBInternalInfoMapMap;
typedef std::unordered_map<uint32 /*guidLow*/, RBInternalInfo> RBInternalInfoMap;
typedef std::unordered_map<uint32 /*dungeonId*/, RBInternalInfoMap> RBInternalInfoMapMap;
RBInternalInfoMapMap RBInternalInfoStorePrev[2]; // for 2 factions
RBInternalInfoMapMap RBInternalInfoStoreCurr[2]; // for 2 factions
typedef std::set<uint32 /*dungeonId*/> RBUsedDungeonsSet; // needs to be ordered

View File

@@ -165,7 +165,7 @@ typedef std::vector<uint32> CreatureQuestItemList;
typedef std::unordered_map<uint32, CreatureQuestItemList> CreatureQuestItemMap;
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer;
typedef std::unordered_map<uint32, CreatureTemplate> CreatureTemplateContainer;
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
#if defined(__GNUC__)
@@ -213,7 +213,7 @@ struct CreatureBaseStats
static CreatureBaseStats const* GetBaseStats(uint8 level, uint8 unitClass);
};
typedef UNORDERED_MAP<uint16, CreatureBaseStats> CreatureBaseStatsContainer;
typedef std::unordered_map<uint16, CreatureBaseStats> CreatureBaseStatsContainer;
struct CreatureLocale
{
@@ -240,8 +240,8 @@ struct EquipmentInfo
};
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint8, EquipmentInfo> EquipmentInfoContainerInternal;
typedef UNORDERED_MAP<uint32, EquipmentInfoContainerInternal> EquipmentInfoContainer;
typedef std::unordered_map<uint8, EquipmentInfo> EquipmentInfoContainerInternal;
typedef std::unordered_map<uint32, EquipmentInfoContainerInternal> EquipmentInfoContainer;
// from `creature` table
struct CreatureData
@@ -282,7 +282,7 @@ struct CreatureModelInfo
};
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint16, CreatureModelInfo> CreatureModelContainer;
typedef std::unordered_map<uint16, CreatureModelInfo> CreatureModelContainer;
enum InhabitTypeValues
{
@@ -323,7 +323,7 @@ struct CreatureAddon
std::vector<uint32> auras;
};
typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer;
typedef std::unordered_map<uint32, CreatureAddon> CreatureAddonContainer;
// Vendors
struct VendorItem
@@ -399,7 +399,7 @@ struct TrainerSpell
bool IsCastable() const { return learnedSpell[0] != spell; }
};
typedef UNORDERED_MAP<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
typedef std::unordered_map<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
struct TrainerSpellData
{

View File

@@ -8,7 +8,7 @@
#define _FORMATIONS_H
#include "Define.h"
#include "UnorderedMap.h"
#include <unordered_map>
#include <map>
class Creature;
@@ -24,7 +24,7 @@ struct FormationInfo
uint16 point_2;
};
typedef UNORDERED_MAP<uint32/*memberDBGUID*/, FormationInfo*> CreatureGroupInfoType;
typedef std::unordered_map<uint32/*memberDBGUID*/, FormationInfo*> CreatureGroupInfoType;
class FormationMgr
{

View File

@@ -541,8 +541,8 @@ struct GameObjectTemplateAddon
};
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint32, GameObjectTemplate> GameObjectTemplateContainer;
typedef UNORDERED_MAP<uint32, GameObjectTemplateAddon> GameObjectTemplateAddonContainer;
typedef std::unordered_map<uint32, GameObjectTemplate> GameObjectTemplateContainer;
typedef std::unordered_map<uint32, GameObjectTemplateAddon> GameObjectTemplateAddonContainer;
class OPvPCapturePoint;
struct TransportAnimation;
@@ -586,7 +586,7 @@ struct GameObjectAddon
uint32 InvisibilityValue;
};
typedef UNORDERED_MAP<uint32, GameObjectAddon> GameObjectAddonContainer;
typedef std::unordered_map<uint32, GameObjectAddon> GameObjectAddonContainer;
// client side GO show states
enum GOState

View File

@@ -28,7 +28,7 @@ struct EnchStoreItem
};
typedef std::vector<EnchStoreItem> EnchStoreList;
typedef UNORDERED_MAP<uint32, EnchStoreList> EnchantmentStore;
typedef std::unordered_map<uint32, EnchStoreList> EnchantmentStore;
static EnchantmentStore RandomItemEnch;

View File

@@ -778,7 +778,7 @@ struct ItemTemplate
};
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint32, ItemTemplate> ItemTemplateContainer;
typedef std::unordered_map<uint32, ItemTemplate> ItemTemplateContainer;
struct ItemLocale
{

View File

@@ -117,8 +117,8 @@ class Transport;
class StaticTransport;
class MotionTransport;
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
typedef UNORDERED_SET<uint32> UpdatePlayerSet;
typedef std::unordered_map<Player*, UpdateData> UpdateDataMapType;
typedef std::unordered_set<uint32> UpdatePlayerSet;
class Object
{

View File

@@ -36,7 +36,7 @@ class AsynchPetSummon
uint64 m_casterGUID;
};
typedef UNORDERED_MAP<uint32, PetSpell> PetSpellMap;
typedef std::unordered_map<uint32, PetSpell> PetSpellMap;
typedef std::vector<uint32> AutoSpellList;
class Player;

View File

@@ -118,8 +118,8 @@ struct SpellModifier
Aura* const ownerAura;
};
typedef UNORDERED_MAP<uint32, PlayerTalent*> PlayerTalentMap;
typedef UNORDERED_MAP<uint32, PlayerSpell*> PlayerSpellMap;
typedef std::unordered_map<uint32, PlayerTalent*> PlayerTalentMap;
typedef std::unordered_map<uint32, PlayerSpell*> PlayerSpellMap;
typedef std::list<SpellModifier*> SpellModList;
typedef std::list<uint64> WhisperListContainer;
@@ -134,7 +134,7 @@ struct SpellCooldown
};
typedef std::map<uint32, SpellCooldown> SpellCooldowns;
typedef UNORDERED_MAP<uint32 /*instanceId*/, time_t/*releaseTime*/> InstanceTimeMap;
typedef std::unordered_map<uint32 /*instanceId*/, time_t/*releaseTime*/> InstanceTimeMap;
enum TrainerSpellState
{
@@ -517,7 +517,7 @@ enum AtLoginFlags
};
typedef std::map<uint32, QuestStatusData> QuestStatusMap;
typedef UNORDERED_SET<uint32> RewardedQuestSet;
typedef std::unordered_set<uint32> RewardedQuestSet;
// quest, keep
typedef std::map<uint32, bool> QuestStatusSaveMap;
@@ -556,7 +556,7 @@ struct SkillStatusData
SkillUpdateState uState;
};
typedef UNORDERED_MAP<uint32, SkillStatusData> SkillStatusMap;
typedef std::unordered_map<uint32, SkillStatusData> SkillStatusMap;
class Quest;
class Spell;
@@ -1637,7 +1637,7 @@ class Player : public Unit, public GridObject<Player>
uint8 unReadMails;
time_t m_nextMailDelivereTime;
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
typedef std::unordered_map<uint32, Item*> ItemMap;
ItemMap mMitems; //template defined in objectmgr.cpp
@@ -2364,7 +2364,7 @@ class Player : public Unit, public GridObject<Player>
void SetEntryPoint();
// currently visible objects at player client
typedef UNORDERED_SET<uint64> ClientGUIDs;
typedef std::unordered_set<uint64> ClientGUIDs;
ClientGUIDs m_clientGUIDs;
std::vector<Unit*> m_newVisible; // pussywizard
@@ -2656,7 +2656,7 @@ class Player : public Unit, public GridObject<Player>
//We allow only one timed quest active at the same time. Below can then be simple value instead of set.
typedef std::set<uint32> QuestSet;
typedef std::set<uint32> SeasonalQuestSet;
typedef UNORDERED_MAP<uint32,SeasonalQuestSet> SeasonalEventQuestMap;
typedef std::unordered_map<uint32,SeasonalQuestSet> SeasonalEventQuestMap;
QuestSet m_timedquests;
QuestSet m_weeklyquests;
QuestSet m_monthlyquests;

View File

@@ -19462,7 +19462,7 @@ void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns c
data.Initialize(SMSG_SPELL_COOLDOWN, 8 + 1 + (4 + 4) * cooldowns.size());
data << uint64(GetGUID());
data << uint8(flags);
for (UNORDERED_MAP<uint32, uint32>::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr)
for (std::unordered_map<uint32, uint32>::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr)
{
data << uint32(itr->first);
data << uint32(itr->second);

View File

@@ -1070,7 +1070,7 @@ struct GlobalCooldown
uint32 cast_time;
};
typedef UNORDERED_MAP<uint32 /*category*/, GlobalCooldown> GlobalCooldownList;
typedef std::unordered_map<uint32 /*category*/, GlobalCooldown> GlobalCooldownList;
class GlobalCooldownMgr // Shared by Player and CharmInfo
{
@@ -1289,7 +1289,7 @@ enum SpellCooldownFlags
SPELL_COOLDOWN_FLAG_INCLUDE_EVENT_COOLDOWNS = 0x2 ///< Starts GCD for spells that should start their cooldown on events, requires SPELL_COOLDOWN_FLAG_INCLUDE_GCD set
};
typedef UNORDERED_MAP<uint32, uint32> PacketCooldowns;
typedef std::unordered_map<uint32, uint32> PacketCooldowns;
// delay time next attack to prevent client attack animation problems
#define ATTACK_DISPLAY_DELAY 200
@@ -1343,7 +1343,7 @@ private:
class Unit : public WorldObject
{
public:
typedef UNORDERED_SET<Unit*> AttackerSet;
typedef std::unordered_set<Unit*> AttackerSet;
typedef std::set<Unit*> ControlSet;
typedef std::multimap<uint32, Aura*> AuraMap;
@@ -1361,7 +1361,7 @@ class Unit : public WorldObject
typedef std::list<Aura*> AuraList;
typedef std::list<AuraApplication *> AuraApplicationList;
typedef std::list<DiminishingReturn> Diminishing;
typedef UNORDERED_SET<uint32> ComboPointHolderSet;
typedef std::unordered_set<uint32> ComboPointHolderSet;
typedef std::map<uint8, AuraApplication*> VisibleAuraMap;

View File

@@ -8,15 +8,12 @@
#define TRINITY_OBJECTACCESSOR_H
#include "Define.h"
#include <ace/Singleton.h>
#include <ace/Thread_Mutex.h>
#include "UnorderedMap.h"
#include "UpdateData.h"
#include "GridDefines.h"
#include "Object.h"
#include <ace/Singleton.h>
#include <ace/Thread_Mutex.h>
#include <unordered_map>
#include <set>
class Creature;
@@ -37,7 +34,7 @@ class HashMapHolder
{
public:
typedef UNORDERED_MAP<uint64, T*> MapType;
typedef std::unordered_map<uint64, T*> MapType;
typedef ACE_RW_Thread_Mutex LockType;
static void Insert(T* o)
@@ -74,7 +71,7 @@ class HashMapHolder
/// Define the static members of HashMapHolder
template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap;
template <class T> std::unordered_map< uint64, T* > HashMapHolder<T>::m_objectMap;
template <class T> typename HashMapHolder<T>::LockType HashMapHolder<T>::i_lock;
// pussywizard:
@@ -267,10 +264,10 @@ class ObjectAccessor
static void _buildPacket(Player*, Object*, UpdateDataMapType&);
void _update();
typedef UNORDERED_MAP<uint64, Corpse*> Player2CorpsesMapType;
typedef UNORDERED_MAP<Player*, UpdateData>::value_type UpdateDataValueType;
typedef std::unordered_map<uint64, Corpse*> Player2CorpsesMapType;
typedef std::unordered_map<Player*, UpdateData>::value_type UpdateDataValueType;
UNORDERED_SET<Object*> i_objects;
std::unordered_set<Object*> i_objects;
Player2CorpsesMapType i_player2corpse;
std::list<uint64> i_playerBones;

View File

@@ -113,11 +113,11 @@ enum ScriptCommands
SCRIPT_COMMAND_PLAYMOVIE = 34 // source = Player, datalong = movie id
};
// Benchmarked: Faster than UNORDERED_MAP (insert/find)
// Benchmarked: Faster than std::unordered_map (insert/find)
typedef std::map<uint32, PageText> PageTextContainer;
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint16, InstanceTemplate> InstanceTemplateContainer;
typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer;
struct GameTele
{
@@ -130,7 +130,7 @@ struct GameTele
std::wstring wnameLow;
};
typedef UNORDERED_MAP<uint32, GameTele > GameTeleContainer;
typedef std::unordered_map<uint32, GameTele > GameTeleContainer;
enum ScriptsType
{
@@ -456,15 +456,15 @@ struct BroadcastText
typedef std::unordered_map<uint32, BroadcastText> BroadcastTextContainer;
typedef std::set<uint32> CellGuidSet;
typedef UNORDERED_MAP<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet;
typedef std::unordered_map<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet;
struct CellObjectGuids
{
CellGuidSet creatures;
CellGuidSet gameobjects;
CellCorpseSet corpses;
};
typedef UNORDERED_MAP<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;
typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
typedef std::unordered_map<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;
typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
// Trinity string ranges
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
@@ -481,21 +481,21 @@ struct TrinityString
};
typedef std::map<uint64, uint64> LinkedRespawnContainer;
typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataContainer;
typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataContainer;
typedef std::unordered_map<uint32, CreatureData> CreatureDataContainer;
typedef std::unordered_map<uint32, GameObjectData> GameObjectDataContainer;
typedef std::map<TempSummonGroupKey, std::vector<TempSummonData> > TempSummonDataContainer;
typedef UNORDERED_MAP<uint32, CreatureLocale> CreatureLocaleContainer;
typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleContainer;
typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleContainer;
typedef UNORDERED_MAP<uint32, ItemSetNameLocale> ItemSetNameLocaleContainer;
typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleContainer;
typedef UNORDERED_MAP<uint32, QuestOfferRewardLocale> QuestOfferRewardLocaleContainer;
typedef UNORDERED_MAP<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleContainer;
typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleContainer;
typedef UNORDERED_MAP<int32, TrinityString> TrinityStringContainer;
typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
typedef UNORDERED_MAP<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
typedef std::unordered_map<uint32, CreatureLocale> CreatureLocaleContainer;
typedef std::unordered_map<uint32, GameObjectLocale> GameObjectLocaleContainer;
typedef std::unordered_map<uint32, ItemLocale> ItemLocaleContainer;
typedef std::unordered_map<uint32, ItemSetNameLocale> ItemSetNameLocaleContainer;
typedef std::unordered_map<uint32, QuestLocale> QuestLocaleContainer;
typedef std::unordered_map<uint32, QuestOfferRewardLocale> QuestOfferRewardLocaleContainer;
typedef std::unordered_map<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
typedef std::unordered_map<uint32, NpcTextLocale> NpcTextLocaleContainer;
typedef std::unordered_map<uint32, PageTextLocale> PageTextLocaleContainer;
typedef std::unordered_map<int32, TrinityString> TrinityStringContainer;
typedef std::unordered_map<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
typedef std::unordered_map<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
typedef std::multimap<uint32, uint32> QuestRelations;
typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds;
@@ -523,7 +523,7 @@ struct MailLevelReward
};
typedef std::list<MailLevelReward> MailLevelRewardList;
typedef UNORDERED_MAP<uint8, MailLevelRewardList> MailLevelRewardContainer;
typedef std::unordered_map<uint8, MailLevelRewardList> MailLevelRewardContainer;
// We assume the rate is in general the same for all three types below, but chose to keep three for scalability and customization
struct RepRewardRate
@@ -625,10 +625,10 @@ struct QuestPOI
};
typedef std::vector<QuestPOI> QuestPOIVector;
typedef UNORDERED_MAP<uint32, QuestPOIVector> QuestPOIContainer;
typedef std::unordered_map<uint32, QuestPOIVector> QuestPOIContainer;
typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemContainer;
typedef UNORDERED_MAP<uint32, TrainerSpellData> CacheTrainerSpellContainer;
typedef std::unordered_map<uint32, VendorItemData> CacheVendorItemContainer;
typedef std::unordered_map<uint32, TrainerSpellData> CacheTrainerSpellContainer;
enum SkillRangeType
{
@@ -671,7 +671,7 @@ struct DungeonEncounter
};
typedef std::list<DungeonEncounter const*> DungeonEncounterList;
typedef UNORDERED_MAP<uint32, DungeonEncounterList> DungeonEncounterContainer;
typedef std::unordered_map<uint32, DungeonEncounterList> DungeonEncounterContainer;
class PlayerDumpReader;
@@ -685,23 +685,23 @@ class ObjectMgr
~ObjectMgr();
public:
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
typedef std::unordered_map<uint32, Item*> ItemMap;
typedef UNORDERED_MAP<uint32, Quest*> QuestMap;
typedef std::unordered_map<uint32, Quest*> QuestMap;
typedef UNORDERED_MAP<uint32, AreaTrigger> AreaTriggerContainer;
typedef std::unordered_map<uint32, AreaTrigger> AreaTriggerContainer;
typedef UNORDERED_MAP<uint32, AreaTriggerTeleport> AreaTriggerTeleportContainer;
typedef std::unordered_map<uint32, AreaTriggerTeleport> AreaTriggerTeleportContainer;
typedef UNORDERED_MAP<uint32, uint32> AreaTriggerScriptContainer;
typedef std::unordered_map<uint32, uint32> AreaTriggerScriptContainer;
typedef UNORDERED_MAP<uint32, AccessRequirement*> AccessRequirementContainer;
typedef std::unordered_map<uint32, AccessRequirement*> AccessRequirementContainer;
typedef UNORDERED_MAP<uint32, RepRewardRate > RepRewardRateContainer;
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillContainer;
typedef UNORDERED_MAP<uint32, RepSpilloverTemplate> RepSpilloverTemplateContainer;
typedef std::unordered_map<uint32, RepRewardRate > RepRewardRateContainer;
typedef std::unordered_map<uint32, ReputationOnKillEntry> RepOnKillContainer;
typedef std::unordered_map<uint32, RepSpilloverTemplate> RepSpilloverTemplateContainer;
typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestContainer;
typedef std::unordered_map<uint32, PointOfInterest> PointOfInterestContainer;
typedef std::vector<std::string> ScriptNameContainer;
@@ -885,7 +885,7 @@ class ObjectMgr
DungeonEncounterList const* GetDungeonEncounterList(uint32 mapId, Difficulty difficulty)
{
UNORDERED_MAP<uint32, DungeonEncounterList>::const_iterator itr = _dungeonEncounterStore.find(MAKE_PAIR32(mapId, difficulty));
std::unordered_map<uint32, DungeonEncounterList>::const_iterator itr = _dungeonEncounterStore.find(MAKE_PAIR32(mapId, difficulty));
if (itr != _dungeonEncounterStore.end())
return &itr->second;
return NULL;
@@ -1349,8 +1349,8 @@ class ObjectMgr
QuestMap _questTemplates;
std::vector<Quest*> _questTemplatesFast; // pussywizard
typedef UNORDERED_MAP<uint32, GossipText> GossipTextContainer;
typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerContainer;
typedef std::unordered_map<uint32, GossipText> GossipTextContainer;
typedef std::unordered_map<uint32, uint32> QuestAreaTriggerContainer;
typedef std::set<uint32> TavernAreaTriggerContainer;
QuestAreaTriggerContainer _questAreaTriggerStore;
@@ -1429,7 +1429,7 @@ class ObjectMgr
HalfNameContainer _petHalfName0;
HalfNameContainer _petHalfName1;
typedef UNORDERED_MAP<uint32, ItemSetNameEntry> ItemSetNameContainer;
typedef std::unordered_map<uint32, ItemSetNameEntry> ItemSetNameContainer;
ItemSetNameContainer _itemSetNameStore;
MapObjectGuids _mapObjectGuidsStore;

View File

@@ -648,7 +648,7 @@ private:
void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count);
};
typedef UNORDERED_MAP<uint32, Member*> Members;
typedef std::unordered_map<uint32, Member*> Members;
typedef std::vector<RankInfo> Ranks;
typedef std::vector<BankTab*> BankTabs;

View File

@@ -32,7 +32,7 @@ public:
void ResetTimes();
protected:
typedef UNORDERED_MAP<uint32, Guild*> GuildContainer;
typedef std::unordered_map<uint32, Guild*> GuildContainer;
uint32 NextGuildId;
GuildContainer GuildStore;
};

View File

@@ -434,14 +434,14 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recvData)
}
// Read quest ids and add the in a unordered_set so we don't send POIs for the same quest multiple times
UNORDERED_SET<uint32> questIds;
std::unordered_set<uint32> questIds;
for (uint32 i = 0; i < count; ++i)
questIds.insert(recvData.read<uint32>()); // quest id
WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4 + (4 + 4)*questIds.size());
data << uint32(questIds.size()); // count
for (UNORDERED_SET<uint32>::const_iterator itr = questIds.begin(); itr != questIds.end(); ++itr)
for (std::unordered_set<uint32>::const_iterator itr = questIds.begin(); itr != questIds.end(); ++itr)
{
uint32 questId = *itr;
bool questOk = false;

View File

@@ -176,7 +176,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data)
uint32 mainSurvey; // GMSurveyCurrentSurvey.dbc, column 1 (all 9) ref to GMSurveySurveys.dbc
recv_data >> mainSurvey;
UNORDERED_SET<uint32> surveyIds;
std::unordered_set<uint32> surveyIds;
SQLTransaction trans = CharacterDatabase.BeginTransaction();
// sub_survey1, r1, comment1, sub_survey2, r2, comment2, sub_survey3, r3, comment3, sub_survey4, r4, comment4, sub_survey5, r5, comment5, sub_survey6, r6, comment6, sub_survey7, r7, comment7, sub_survey8, r8, comment8, sub_survey9, r9, comment9, sub_survey10, r10, comment10,
for (uint8 i = 0; i < 10; i++)

View File

@@ -8,15 +8,15 @@
#define _INSTANCESAVEMGR_H
#include "Define.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
#include "ObjectDefines.h"
#include <ace/Singleton.h>
#include <ace/Null_Mutex.h>
#include <ace/Thread_Mutex.h>
#include <list>
#include <map>
#include "UnorderedMap.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
#include "ObjectDefines.h"
#include <unordered_map>
struct InstanceTemplate;
struct MapEntry;
@@ -33,14 +33,14 @@ struct InstancePlayerBind
InstancePlayerBind() : save(NULL), perm(false), extended(false) {}
};
typedef UNORDERED_MAP< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap;
typedef std::unordered_map< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap;
struct BoundInstancesMapWrapper
{
BoundInstancesMap m[MAX_DIFFICULTY];
};
typedef UNORDERED_MAP< uint32 /*guidLow*/, BoundInstancesMapWrapper* > PlayerBindStorage;
typedef std::unordered_map< uint32 /*guidLow*/, BoundInstancesMapWrapper* > PlayerBindStorage;
class InstanceSave
{
@@ -94,7 +94,7 @@ class InstanceSave
ACE_Thread_Mutex _lock;
};
typedef UNORDERED_MAP<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
typedef std::unordered_map<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
class InstanceSaveManager
{
@@ -106,7 +106,7 @@ class InstanceSaveManager
~InstanceSaveManager();
public:
typedef UNORDERED_MAP<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
typedef std::unordered_map<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
struct InstResetEvent
{

View File

@@ -26,7 +26,7 @@ struct StoredLootItem
};
typedef std::list<StoredLootItem> StoredLootItemList;
typedef UNORDERED_MAP<uint32, StoredLootItemList> LootItemContainer;
typedef std::unordered_map<uint32, StoredLootItemList> LootItemContainer;
class LootItemStorage
{

View File

@@ -186,7 +186,7 @@ typedef std::vector<QuestItem> QuestItemList;
typedef std::vector<LootItem> LootItemList;
typedef std::map<uint32, QuestItemList*> QuestItemMap;
typedef std::list<LootStoreItem*> LootStoreItemList;
typedef UNORDERED_MAP<uint32, LootTemplate*> LootTemplateMap;
typedef std::unordered_map<uint32, LootTemplate*> LootTemplateMap;
typedef std::set<uint32> LootIdSet;

View File

@@ -783,7 +783,7 @@ void Map::HandleDelayedVisibility()
{
if (i_objectsForDelayedVisibility.empty())
return;
for (UNORDERED_SET<Unit*>::iterator itr = i_objectsForDelayedVisibility.begin(); itr != i_objectsForDelayedVisibility.end(); ++itr)
for (std::unordered_set<Unit*>::iterator itr = i_objectsForDelayedVisibility.begin(); itr != i_objectsForDelayedVisibility.end(); ++itr)
(*itr)->ExecuteDelayedUnitRelocationEvent();
i_objectsForDelayedVisibility.clear();
}
@@ -2359,7 +2359,7 @@ void Map::RemoveAllObjectsInRemoveList()
//sLog->outDebug(LOG_FILTER_MAPS, "Object remover 1 check.");
while (!i_objectsToRemove.empty())
{
UNORDERED_SET<WorldObject*>::iterator itr = i_objectsToRemove.begin();
std::unordered_set<WorldObject*>::iterator itr = i_objectsToRemove.begin();
WorldObject* obj = *itr;
i_objectsToRemove.erase(itr);

View File

@@ -255,7 +255,7 @@ struct ZoneDynamicInfo
#define MIN_UNLOAD_DELAY 1 // immediate unload
typedef std::map<uint32/*leaderDBGUID*/, CreatureGroup*> CreatureGroupHolderType;
typedef UNORDERED_MAP<uint32 /*zoneId*/, ZoneDynamicInfo> ZoneDynamicInfoMap;
typedef std::unordered_map<uint32 /*zoneId*/, ZoneDynamicInfo> ZoneDynamicInfoMap;
typedef std::set<MotionTransport*> TransportsContainer;
enum EncounterCreditType
@@ -332,9 +332,9 @@ class Map : public GridRefManager<NGridType>
// pussywizard: movemaps, mmaps
ACE_RW_Thread_Mutex& GetMMapLock() const { return *(const_cast<ACE_RW_Thread_Mutex*>(&MMapLock)); }
// pussywizard:
UNORDERED_SET<Object*> i_objectsToUpdate;
std::unordered_set<Object*> i_objectsToUpdate;
void BuildAndSendUpdateForObjects(); // definition in ObjectAccessor.cpp, below ObjectAccessor::Update, because it does the same for a map
UNORDERED_SET<Unit*> i_objectsForDelayedVisibility;
std::unordered_set<Unit*> i_objectsForDelayedVisibility;
void HandleDelayedVisibility();
// some calls like isInWater should not use vmaps due to processor power
@@ -470,7 +470,7 @@ class Map : public GridRefManager<NGridType>
time_t GetLinkedRespawnTime(uint64 guid) const;
time_t GetCreatureRespawnTime(uint32 dbGuid) const
{
UNORDERED_MAP<uint32 /*dbGUID*/, time_t>::const_iterator itr = _creatureRespawnTimes.find(dbGuid);
std::unordered_map<uint32 /*dbGUID*/, time_t>::const_iterator itr = _creatureRespawnTimes.find(dbGuid);
if (itr != _creatureRespawnTimes.end())
return itr->second;
@@ -479,7 +479,7 @@ class Map : public GridRefManager<NGridType>
time_t GetGORespawnTime(uint32 dbGuid) const
{
UNORDERED_MAP<uint32 /*dbGUID*/, time_t>::const_iterator itr = _goRespawnTimes.find(dbGuid);
std::unordered_map<uint32 /*dbGUID*/, time_t>::const_iterator itr = _goRespawnTimes.find(dbGuid);
if (itr != _goRespawnTimes.end())
return itr->second;
@@ -601,9 +601,9 @@ class Map : public GridRefManager<NGridType>
std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP*TOTAL_NUMBER_OF_CELLS_PER_MAP> marked_cells;
bool i_scriptLock;
UNORDERED_SET<WorldObject*> i_objectsToRemove;
std::unordered_set<WorldObject*> i_objectsToRemove;
std::map<WorldObject*, bool> i_objectsToSwitch;
UNORDERED_SET<WorldObject*> i_worldObjects;
std::unordered_set<WorldObject*> i_worldObjects;
typedef std::multimap<time_t, ScriptAction> ScriptScheduleMap;
ScriptScheduleMap m_scriptSchedule;
@@ -636,8 +636,8 @@ class Map : public GridRefManager<NGridType>
m_activeNonPlayers.erase(obj);
}
UNORDERED_MAP<uint32 /*dbGUID*/, time_t> _creatureRespawnTimes;
UNORDERED_MAP<uint32 /*dbGUID*/, time_t> _goRespawnTimes;
std::unordered_map<uint32 /*dbGUID*/, time_t> _creatureRespawnTimes;
std::unordered_map<uint32 /*dbGUID*/, time_t> _goRespawnTimes;
ZoneDynamicInfoMap _zoneDynamicInfo;
uint32 _defaultLight;

View File

@@ -15,7 +15,7 @@ class MapInstanced : public Map
{
friend class MapManager;
public:
typedef UNORDERED_MAP< uint32, Map*> InstancedMaps;
typedef std::unordered_map< uint32, Map*> InstancedMaps;
MapInstanced(uint32 id);
~MapInstanced() {}

View File

@@ -122,7 +122,7 @@ class MapManager
MapUpdater * GetMapUpdater() { return &m_updater; }
private:
typedef UNORDERED_MAP<uint32, Map*> MapMapType;
typedef std::unordered_map<uint32, Map*> MapMapType;
typedef std::vector<bool> InstanceIds;
MapManager();

View File

@@ -22,10 +22,10 @@ class Map;
typedef Movement::Spline<double> TransportSpline;
typedef std::vector<KeyFrame> KeyFrameVec;
typedef UNORDERED_MAP<uint32, TransportTemplate> TransportTemplates;
typedef std::unordered_map<uint32, TransportTemplate> TransportTemplates;
typedef std::set<MotionTransport*> TransportSet;
typedef UNORDERED_MAP<uint32, TransportSet> TransportMap;
typedef UNORDERED_MAP<uint32, std::set<uint32> > TransportInstanceMap;
typedef std::unordered_map<uint32, TransportSet> TransportMap;
typedef std::unordered_map<uint32, std::set<uint32> > TransportInstanceMap;
struct KeyFrame
{

View File

@@ -32,7 +32,7 @@ class Graveyard
public:
typedef UNORDERED_MAP<uint32, GraveyardStruct> GraveyardContainer;
typedef std::unordered_map<uint32, GraveyardStruct> GraveyardContainer;
GraveyardStruct const* GetGraveyard(uint32 ID) const;
GraveyardStruct const* GetGraveyard(const std::string& name) const;

View File

@@ -32,7 +32,7 @@ struct WaypointData
};
typedef std::vector<WaypointData*> WaypointPath;
typedef UNORDERED_MAP<uint32, WaypointPath> WaypointPathContainer;
typedef std::unordered_map<uint32, WaypointPath> WaypointPathContainer;
class WaypointMgr
{

View File

@@ -29,7 +29,7 @@ class Pool // for Pool of Pool
{
};
typedef UNORDERED_SET<uint32> ActivePoolObjects;
typedef std::unordered_set<uint32> ActivePoolObjects;
typedef std::map<uint32, uint32> ActivePoolPools;
class ActivePoolData

View File

@@ -54,7 +54,7 @@ class SystemMgr
~SystemMgr() {}
public:
typedef UNORDERED_MAP<uint32, ScriptPointVector> PointMoveMap;
typedef std::unordered_map<uint32, ScriptPointVector> PointMoveMap;
//Database
void LoadScriptWaypoints();

View File

@@ -28,7 +28,7 @@ struct SkillDiscoveryEntry
};
typedef std::list<SkillDiscoveryEntry> SkillDiscoveryList;
typedef UNORDERED_MAP<int32, SkillDiscoveryList> SkillDiscoveryMap;
typedef std::unordered_map<int32, SkillDiscoveryList> SkillDiscoveryMap;
static SkillDiscoveryMap SkillDiscoveryStore;

View File

@@ -273,7 +273,7 @@ struct SpellProcEventEntry
uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_
};
typedef UNORDERED_MAP<uint32, SpellProcEventEntry> SpellProcEventMap;
typedef std::unordered_map<uint32, SpellProcEventEntry> SpellProcEventMap;
struct SpellProcEntry
{
@@ -291,7 +291,7 @@ struct SpellProcEntry
uint32 charges; // if nonzero - owerwrite procCharges field for given Spell.dbc entry, defines how many times proc can occur before aura remove, 0 - infinite
};
typedef UNORDERED_MAP<uint32, SpellProcEntry> SpellProcMap;
typedef std::unordered_map<uint32, SpellProcEntry> SpellProcMap;
struct SpellEnchantProcEntry
{
@@ -300,7 +300,7 @@ struct SpellEnchantProcEntry
uint32 procEx;
};
typedef UNORDERED_MAP<uint32, SpellEnchantProcEntry> SpellEnchantProcEventMap;
typedef std::unordered_map<uint32, SpellEnchantProcEntry> SpellEnchantProcEventMap;
struct SpellBonusEntry
{
@@ -310,7 +310,7 @@ struct SpellBonusEntry
float ap_dot_bonus;
};
typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
typedef std::unordered_map<uint32, SpellBonusEntry> SpellBonusMap;
enum SpellGroupSpecialFlags
{
@@ -444,7 +444,7 @@ enum EffectRadiusIndex
class PetAura
{
private:
typedef UNORDERED_MAP<uint32, uint32> PetAuraMap;
typedef std::unordered_map<uint32, uint32> PetAuraMap;
public:
PetAura() : removeOnChangePet(false), damage(0)
@@ -527,7 +527,7 @@ struct SpellChainNode
uint8 rank;
};
typedef UNORDERED_MAP<uint32, SpellChainNode> SpellChainMap;
typedef std::unordered_map<uint32, SpellChainNode> SpellChainMap;
// spell_id req_spell
typedef std::multimap<uint32, uint32> SpellRequiredMap;

View File

@@ -60,15 +60,15 @@ struct CreatureTextId
};
typedef std::vector<CreatureTextEntry> CreatureTextGroup; // texts in a group
typedef UNORDERED_MAP<uint8, CreatureTextGroup> CreatureTextHolder; // groups for a creature by groupid
typedef UNORDERED_MAP<uint32, CreatureTextHolder> CreatureTextMap; // all creatures by entry
typedef std::unordered_map<uint8, CreatureTextGroup> CreatureTextHolder; // groups for a creature by groupid
typedef std::unordered_map<uint32, CreatureTextHolder> CreatureTextMap; // all creatures by entry
typedef std::map<CreatureTextId, CreatureTextLocale> LocaleCreatureTextMap;
//used for handling non-repeatable random texts
typedef std::vector<uint8> CreatureTextRepeatIds;
typedef UNORDERED_MAP<uint8, CreatureTextRepeatIds> CreatureTextRepeatGroup;
typedef UNORDERED_MAP<uint64, CreatureTextRepeatGroup> CreatureTextRepeatMap;//guid based
typedef std::unordered_map<uint8, CreatureTextRepeatIds> CreatureTextRepeatGroup;
typedef std::unordered_map<uint64, CreatureTextRepeatGroup> CreatureTextRepeatMap;//guid based
class CreatureTextMgr
{

View File

@@ -22,8 +22,8 @@ namespace WeatherMgr
namespace
{
typedef UNORDERED_MAP<uint32, Trinity::AutoPtr<Weather, ACE_Null_Mutex> > WeatherMap;
typedef UNORDERED_MAP<uint32, WeatherData> WeatherZoneMap;
typedef std::unordered_map<uint32, Trinity::AutoPtr<Weather, ACE_Null_Mutex> > WeatherMap;
typedef std::unordered_map<uint32, WeatherData> WeatherZoneMap;
WeatherMap m_weathers;
WeatherZoneMap mWeatherZoneMap;

View File

@@ -510,7 +510,7 @@ struct CliCommandHolder
~CliCommandHolder() { delete[] m_command; }
};
typedef UNORDERED_MAP<uint32, WorldSession*> SessionMap;
typedef std::unordered_map<uint32, WorldSession*> SessionMap;
#define WORLD_SLEEP_CONST 10
@@ -820,7 +820,7 @@ class World
SessionMap m_sessions;
SessionMap m_offlineSessions;
typedef UNORDERED_MAP<uint32, time_t> DisconnectMap;
typedef std::unordered_map<uint32, time_t> DisconnectMap;
DisconnectMap m_disconnects;
uint32 m_maxActiveSessionCount;
uint32 m_maxQueuedSessionCount;

View File

@@ -478,7 +478,7 @@ public:
uint64 StomachEnterTarget;
//Stomach map, bool = true then in stomach
UNORDERED_MAP<uint64, bool> Stomach_Map;
std::unordered_map<uint64, bool> Stomach_Map;
void Reset()
{
@@ -531,7 +531,7 @@ public:
if (Stomach_Map.empty())
return NULL;
UNORDERED_MAP<uint64, bool>::const_iterator i = Stomach_Map.begin();
std::unordered_map<uint64, bool>::const_iterator i = Stomach_Map.begin();
std::list<Unit*> temp;
std::list<Unit*>::const_iterator j;
@@ -675,7 +675,7 @@ public:
DoCast(me, SPELL_PURPLE_COLORATION, true);
UNORDERED_MAP<uint64, bool>::iterator i = Stomach_Map.begin();
std::unordered_map<uint64, bool>::iterator i = Stomach_Map.begin();
//Kick all players out of stomach
while (i != Stomach_Map.end())
@@ -707,7 +707,7 @@ public:
if (StomachAcidTimer <= diff)
{
//Apply aura to all players in stomach
UNORDERED_MAP<uint64, bool>::iterator i = Stomach_Map.begin();
std::unordered_map<uint64, bool>::iterator i = Stomach_Map.begin();
while (i != Stomach_Map.end())
{