From 09280b0091474b58d43daf42c0f3d99f86e6ec25 Mon Sep 17 00:00:00 2001 From: KingPin Date: Mon, 10 Nov 2008 06:53:00 -0600 Subject: [svn] * Switch from hashmap to unordered map. - cleanup source - mangos. Help - Aokromes --HG-- branch : trunk rename : src/framework/Utilities/HashMap.h => src/framework/Utilities/UnorderedMap.h --- src/bindings/scripts/ScriptMgr.cpp | 8 +-- .../scripts/scripts/creature/mob_event_ai.cpp | 2 +- .../scripts/scripts/creature/mob_event_ai.h | 4 +- .../scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp | 8 +-- src/framework/Dynamic/ObjectRegistry.h | 2 +- src/framework/Makefile.am | 2 +- src/framework/Utilities/HashMap.h | 65 ------------------- src/framework/Utilities/UnorderedMap.h | 72 ++++++++++++++++++++++ src/game/Group.h | 2 +- src/game/HateMatrix.h | 2 +- src/game/InstanceSaveMgr.h | 4 +- src/game/ItemEnchantmentMgr.cpp | 2 +- src/game/LootMgr.h | 2 +- src/game/Map.h | 2 +- src/game/MapInstanced.h | 2 +- src/game/MapManager.h | 4 +- src/game/Object.h | 2 +- src/game/ObjectAccessor.cpp | 2 +- src/game/ObjectAccessor.h | 8 +-- src/game/ObjectMgr.h | 58 ++++++++--------- src/game/Pet.h | 2 +- src/game/Player.h | 6 +- src/game/SkillDiscovery.cpp | 2 +- src/game/SpellMgr.h | 8 +-- src/game/WaypointManager.h | 4 +- src/game/World.h | 4 +- src/shared/Common.h | 2 +- src/shared/Database/Database.h | 6 +- win/VC71/framework.vcproj | 2 +- win/VC80/framework.vcproj | 2 +- win/VC90/framework.vcproj | 2 +- 31 files changed, 150 insertions(+), 143 deletions(-) delete mode 100644 src/framework/Utilities/HashMap.h create mode 100644 src/framework/Utilities/UnorderedMap.h diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index bec1d21036c..3b553af3ee6 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -45,7 +45,7 @@ enum ChatType #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available // Text Maps -HM_NAMESPACE::hash_map TextMap; +UNORDERED_MAP TextMap; //*** End Global data *** @@ -55,10 +55,10 @@ HM_NAMESPACE::hash_map TextMap; std::list EventAI_Event_List; //Event AI summon structure. Used exclusivly by mob_event_ai.cpp. -HM_NAMESPACE::hash_map EventAI_Summon_Map; +UNORDERED_MAP EventAI_Summon_Map; //Event AI error prevention structure. Used at runtime to prevent error log spam of same creature id. -//HM_NAMESPACE::hash_map EventAI_CreatureErrorPreventionList; +//UNORDERED_MAP EventAI_CreatureErrorPreventionList; uint32 EAI_ErrorLevel; //*** End EventAI data *** @@ -1792,7 +1792,7 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target) return; } - HM_NAMESPACE::hash_map::iterator i = TextMap.find(textEntry); + UNORDERED_MAP::iterator i = TextMap.find(textEntry); if (i == TextMap.end()) { diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 0a9fdd8c02b..d403bcb4111 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -864,7 +864,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI //Duration Creature* pCreature = NULL; - HM_NAMESPACE::hash_map::iterator i = EventAI_Summon_Map.find(param3); + UNORDERED_MAP::iterator i = EventAI_Summon_Map.find(param3); if (i == EventAI_Summon_Map.end()) { diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h index 79300326bbc..1183fdd3c73 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.h +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h @@ -195,7 +195,7 @@ struct EventAI_Summon }; //EventSummon_Map -extern HM_NAMESPACE::hash_map EventAI_Summon_Map; +extern UNORDERED_MAP EventAI_Summon_Map; //EventAI Error handling extern uint32 EAI_ErrorLevel; @@ -208,7 +208,7 @@ struct EventAI_CreatureError }; //Error prevention list -extern HM_NAMESPACE::hash_map EventAI_CreatureErrorPreventionList; +extern UNORDERED_MAP EventAI_CreatureErrorPreventionList; //Defines #define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature." diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp index 266c0de4cee..0116947e390 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp @@ -475,7 +475,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI uint64 StomachEnterTarget; //Stomach map, bool = true then in stomach - HM_NAMESPACE::hash_map Stomach_Map; + UNORDERED_MAP Stomach_Map; void Reset() { @@ -534,7 +534,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI if (Stomach_Map.empty()) return NULL; - HM_NAMESPACE::hash_map::iterator i = Stomach_Map.begin(); + UNORDERED_MAP::iterator i = Stomach_Map.begin(); std::list temp; std::list::iterator j; @@ -681,7 +681,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI DoCast(m_creature, SPELL_RED_COLORATION, true); - HM_NAMESPACE::hash_map::iterator i = Stomach_Map.begin(); + UNORDERED_MAP::iterator i = Stomach_Map.begin(); //Kick all players out of stomach while (i != Stomach_Map.end()) @@ -713,7 +713,7 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI if (StomachAcidTimer < diff) { //Apply aura to all players in stomach - HM_NAMESPACE::hash_map::iterator i = Stomach_Map.begin(); + UNORDERED_MAP::iterator i = Stomach_Map.begin(); while (i != Stomach_Map.end()) { diff --git a/src/framework/Dynamic/ObjectRegistry.h b/src/framework/Dynamic/ObjectRegistry.h index 8c2f58be7c1..83a99766e80 100644 --- a/src/framework/Dynamic/ObjectRegistry.h +++ b/src/framework/Dynamic/ObjectRegistry.h @@ -22,7 +22,7 @@ #define TRINITY_OBJECTREGISTRY_H #include "Platform/Define.h" -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include "Policies/Singleton.h" #include diff --git a/src/framework/Makefile.am b/src/framework/Makefile.am index c114fd95063..081b1cc9b44 100644 --- a/src/framework/Makefile.am +++ b/src/framework/Makefile.am @@ -60,6 +60,6 @@ EXTRA_DIST = \ Utilities/ByteConverter.h \ Utilities/Callback.h \ Utilities/EventProcessor.h \ - Utilities/HashMap.h \ + Utilities/UnorderedMap.h \ Utilities/LinkedList.h \ Utilities/TypeList.h diff --git a/src/framework/Utilities/HashMap.h b/src/framework/Utilities/HashMap.h deleted file mode 100644 index ed124bc4bf7..00000000000 --- a/src/framework/Utilities/HashMap.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * Copyright (C) 2008 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_HASHMAP_H -#define TRINITY_HASHMAP_H - -#include "Platform/CompilerDefs.h" -#include "Platform/Define.h" - -#if COMPILER == COMPILER_INTEL -#include -#elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 -#include -#else -#include -#endif - -#ifdef _STLPORT_VERSION -#define HM_NAMESPACE std -using std::hash_map; -#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300 -#define HM_NAMESPACE stdext -using stdext::hash_map; -#elif COMPILER == COMPILER_INTEL -#define HM_NAMESPACE std -using std::hash_map; -#elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 -#define HM_NAMESPACE __gnu_cxx -using __gnu_cxx::hash_map; - -namespace __gnu_cxx -{ - template<> struct hash - { - size_t operator()(const unsigned long long &__x) const { return (size_t)__x; } - }; - template struct hash - { - size_t operator()(T * const &__x) const { return (size_t)__x; } - }; - -}; - -#else -#define HM_NAMESPACE std -using std::hash_map; -#endif -#endif diff --git a/src/framework/Utilities/UnorderedMap.h b/src/framework/Utilities/UnorderedMap.h new file mode 100644 index 00000000000..17d1742fc6c --- /dev/null +++ b/src/framework/Utilities/UnorderedMap.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRINITY_UNORDERED_MAP_H +#define TRINITY_UNORDERED_MAP_H + +#include "Platform/CompilerDefs.h" +#include "Platform/Define.h" + +#if COMPILER == COMPILER_INTEL +#include +#elif COMPILER == COMPILER_GNU && __GNUC__ >= 4 +#include +#elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 +#include +#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1 // VC9.0 and later +#include +#else +#include +#endif + +#ifdef _STLPORT_VERSION +#define UNORDERED_MAP std::hash_map +using std::hash_map; +#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1500 && _HAS_TR1 +#define UNORDERED_MAP std::tr1::unordered_map +#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300 +#define UNORDERED_MAP stdext::hash_map +using stdext::hash_map; +#elif COMPILER == COMPILER_INTEL +#define UNORDERED_MAP std::hash_map +using std::hash_map; +#elif COMPILER == COMPILER_GNU && __GNUC__ >= 4 +#define UNORDERED_MAP std::tr1::unordered_map +#elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 +#define UNORDERED_MAP std::__gnu_cxx::hash_map + +namespace __gnu_cxx +{ + template<> struct hash + { + size_t operator()(const unsigned long long &__x) const { return (size_t)__x; } + }; + template struct hash + { + size_t operator()(T * const &__x) const { return (size_t)__x; } + }; + +}; + +#else +#define UNORDERED_MAP std::hash_map +using std::hash_map; +#endif +#endif diff --git a/src/game/Group.h b/src/game/Group.h index 24546195682..d6c69a857db 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -142,7 +142,7 @@ class TRINITY_DLL_SPEC Group typedef std::list MemberSlotList; typedef MemberSlotList::const_iterator member_citerator; - typedef HM_NAMESPACE::hash_map< uint32 /*mapId*/, InstanceGroupBind> BoundInstancesMap; + typedef UNORDERED_MAP< uint32 /*mapId*/, InstanceGroupBind> BoundInstancesMap; protected: typedef MemberSlotList::iterator member_witerator; typedef std::set InvitesList; diff --git a/src/game/HateMatrix.h b/src/game/HateMatrix.h index 7a21d410362..f4c7d62f5cd 100644 --- a/src/game/HateMatrix.h +++ b/src/game/HateMatrix.h @@ -21,7 +21,7 @@ #ifndef TRINITY_HATEMATRIX_H #define TRINITY_HATEMATRIX_H -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include class Unit; diff --git a/src/game/InstanceSaveMgr.h b/src/game/InstanceSaveMgr.h index cf76ee38781..7dcf13aede8 100644 --- a/src/game/InstanceSaveMgr.h +++ b/src/game/InstanceSaveMgr.h @@ -27,7 +27,7 @@ #include "zthread/Mutex.h" #include #include -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include "Database/DatabaseEnv.h" struct InstanceTemplate; @@ -121,7 +121,7 @@ class TRINITY_DLL_DECL InstanceSaveManager : public Trinity::Singleton InstanceSaveMap; - typedef HM_NAMESPACE::hash_map InstanceSaveHashMap; + typedef UNORDERED_MAP InstanceSaveHashMap; typedef std::map InstanceSaveMapMap; /* resetTime is a global propery of each (raid/heroic) map diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp index 8e87ebb857d..6d4197b0335 100644 --- a/src/game/ItemEnchantmentMgr.cpp +++ b/src/game/ItemEnchantmentMgr.cpp @@ -42,7 +42,7 @@ struct EnchStoreItem }; typedef std::vector EnchStoreList; -typedef HM_NAMESPACE::hash_map EnchantmentStore; +typedef UNORDERED_MAP EnchantmentStore; static EnchantmentStore RandomItemEnch; diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h index e18d0380b8c..1cb02c29bfc 100644 --- a/src/game/LootMgr.h +++ b/src/game/LootMgr.h @@ -122,7 +122,7 @@ class LootTemplate; typedef std::vector QuestItemList; typedef std::map QuestItemMap; typedef std::vector LootStoreItemList; -typedef HM_NAMESPACE::hash_map LootTemplateMap; +typedef UNORDERED_MAP LootTemplateMap; typedef std::set LootIdSet; diff --git a/src/game/Map.h b/src/game/Map.h index 5e4b408b505..2ded7cf0975 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -118,7 +118,7 @@ enum LevelRequirementVsMode #pragma pack(pop) #endif -typedef HM_NAMESPACE::hash_map CreatureMoveList; +typedef UNORDERED_MAP CreatureMoveList; #define MAX_HEIGHT 100000.0f // can be use for find ground height at surface #define INVALID_HEIGHT -100000.0f // for check, must be equal to VMAP_INVALID_HEIGHT, real value for unknown height is VMAP_INVALID_HEIGHT_VALUE diff --git a/src/game/MapInstanced.h b/src/game/MapInstanced.h index 460bf49f542..44f39facbfe 100644 --- a/src/game/MapInstanced.h +++ b/src/game/MapInstanced.h @@ -28,7 +28,7 @@ class TRINITY_DLL_DECL MapInstanced : public Map { friend class MapManager; public: - typedef HM_NAMESPACE::hash_map< uint32, Map* > InstancedMaps; + typedef UNORDERED_MAP< uint32, Map* > InstancedMaps; MapInstanced(uint32 id, time_t, uint32 aInstanceId); ~MapInstanced() {} diff --git a/src/game/MapManager.h b/src/game/MapManager.h index 54b80c70348..44197ccd84a 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -33,8 +33,8 @@ class TRINITY_DLL_DECL MapManager : public Trinity::Singleton; - typedef HM_NAMESPACE::hash_map MapMapType; - typedef std::pair::iterator, bool> MapMapPair; + typedef UNORDERED_MAP MapMapType; + typedef std::pair::iterator, bool> MapMapPair; public: diff --git a/src/game/Object.h b/src/game/Object.h index 943b28b7943..f5dbe92010c 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -94,7 +94,7 @@ class UpdateMask; class InstanceData; class GameObject; -typedef HM_NAMESPACE::hash_map UpdateDataMapType; +typedef UNORDERED_MAP UpdateDataMapType; struct WorldLocation { diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index c81a6303be6..654645f3068 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -669,7 +669,7 @@ void ObjectAccessor::UpdateVisibilityForPlayer( Player* player ) /// Define the static member of HashMapHolder -template HM_NAMESPACE::hash_map< uint64, T* > HashMapHolder::m_objectMap; +template UNORDERED_MAP< uint64, T* > HashMapHolder::m_objectMap; template ZThread::FastMutex HashMapHolder::i_lock; /// Global defintions for the hashmap storage diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index d7dde01f640..88d459ffa08 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -24,7 +24,7 @@ #include "Platform/Define.h" #include "Policies/Singleton.h" #include "zthread/FastMutex.h" -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include "Policies/ThreadingModel.h" #include "ByteBuffer.h" @@ -49,7 +49,7 @@ class HashMapHolder { public: - typedef HM_NAMESPACE::hash_map< uint64, T* > MapType; + typedef UNORDERED_MAP< uint64, T* > MapType; typedef ZThread::FastMutex LockType; typedef Trinity::GeneralLock Guard; @@ -91,8 +91,8 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton Player2CorpsesMapType; - typedef HM_NAMESPACE::hash_map::value_type UpdateDataValueType; + typedef UNORDERED_MAP Player2CorpsesMapType; + typedef UNORDERED_MAP::value_type UpdateDataValueType; template static T* GetObjectInWorld(uint64 guid, T* /*fake*/) { diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index c40ba87d7f2..a5d8a679fdd 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -74,7 +74,7 @@ struct GameTele std::wstring wnameLow; }; -typedef HM_NAMESPACE::hash_map GameTeleMap; +typedef UNORDERED_MAP GameTeleMap; typedef std::list CacheNpcOptionList; struct ScriptInfo @@ -123,26 +123,26 @@ struct CellObjectGuids CellGuidSet gameobjects; CellCorpseSet corpses; }; -typedef HM_NAMESPACE::hash_map CellObjectGuidsMap; -typedef HM_NAMESPACE::hash_map MapObjectGuids; +typedef UNORDERED_MAP CellObjectGuidsMap; +typedef UNORDERED_MAP MapObjectGuids; -typedef HM_NAMESPACE::hash_map RespawnTimes; +typedef UNORDERED_MAP RespawnTimes; struct TrinityStringLocale { std::vector Content; // 0 -> default, i -> i-1 locale index }; -typedef HM_NAMESPACE::hash_map CreatureDataMap; -typedef HM_NAMESPACE::hash_map GameObjectDataMap; -typedef HM_NAMESPACE::hash_map CreatureLocaleMap; -typedef HM_NAMESPACE::hash_map GameObjectLocaleMap; -typedef HM_NAMESPACE::hash_map ItemLocaleMap; -typedef HM_NAMESPACE::hash_map QuestLocaleMap; -typedef HM_NAMESPACE::hash_map NpcTextLocaleMap; -typedef HM_NAMESPACE::hash_map PageTextLocaleMap; -typedef HM_NAMESPACE::hash_map TrinityStringLocaleMap; -typedef HM_NAMESPACE::hash_map NpcOptionLocaleMap; +typedef UNORDERED_MAP CreatureDataMap; +typedef UNORDERED_MAP GameObjectDataMap; +typedef UNORDERED_MAP CreatureLocaleMap; +typedef UNORDERED_MAP GameObjectLocaleMap; +typedef UNORDERED_MAP ItemLocaleMap; +typedef UNORDERED_MAP QuestLocaleMap; +typedef UNORDERED_MAP NpcTextLocaleMap; +typedef UNORDERED_MAP PageTextLocaleMap; +typedef UNORDERED_MAP TrinityStringLocaleMap; +typedef UNORDERED_MAP NpcOptionLocaleMap; typedef std::multimap QuestRelations; @@ -228,7 +228,7 @@ typedef struct _tagCachePlayerInfo uint32 unArenaInfoSlot1; uint32 unArenaInfoSlot2; }CachePlayerInfo, *PCachePlayerInfo; -typedef HM_NAMESPACE::hash_map CachePlayerInfoMap; +typedef UNORDERED_MAP CachePlayerInfoMap; struct PlayerCondition { @@ -249,11 +249,11 @@ struct PlayerCondition }; // NPC gossip text id -typedef HM_NAMESPACE::hash_map CacheNpcTextIdMap; +typedef UNORDERED_MAP CacheNpcTextIdMap; -typedef HM_NAMESPACE::hash_map CacheVendorItemMap; -typedef HM_NAMESPACE::hash_map CacheTrainerSpellMap; +typedef UNORDERED_MAP CacheVendorItemMap; +typedef UNORDERED_MAP CacheTrainerSpellMap; enum SkillRangeType { @@ -291,23 +291,23 @@ class ObjectMgr ObjectMgr(); ~ObjectMgr(); - typedef HM_NAMESPACE::hash_map ItemMap; + typedef UNORDERED_MAP ItemMap; typedef std::set< Group * > GroupSet; typedef std::set< Guild * > GuildSet; typedef std::set< ArenaTeam * > ArenaTeamSet; - typedef HM_NAMESPACE::hash_map QuestMap; + typedef UNORDERED_MAP QuestMap; - typedef HM_NAMESPACE::hash_map AreaTriggerMap; + typedef UNORDERED_MAP AreaTriggerMap; - typedef HM_NAMESPACE::hash_map AreaTriggerScriptMap; + typedef UNORDERED_MAP AreaTriggerScriptMap; - typedef HM_NAMESPACE::hash_map RepOnKillMap; + typedef UNORDERED_MAP RepOnKillMap; - typedef HM_NAMESPACE::hash_map WeatherZoneMap; + typedef UNORDERED_MAP WeatherZoneMap; - typedef HM_NAMESPACE::hash_map PetCreateSpellMap; + typedef UNORDERED_MAP PetCreateSpellMap; Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);} Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); } @@ -803,10 +803,10 @@ class ObjectMgr QuestMap mQuestTemplates; - typedef HM_NAMESPACE::hash_map GossipTextMap; - typedef HM_NAMESPACE::hash_map QuestAreaTriggerMap; - typedef HM_NAMESPACE::hash_map BattleMastersMap; - typedef HM_NAMESPACE::hash_map ItemTextMap; + typedef UNORDERED_MAP GossipTextMap; + typedef UNORDERED_MAP QuestAreaTriggerMap; + typedef UNORDERED_MAP BattleMastersMap; + typedef UNORDERED_MAP ItemTextMap; typedef std::set TavernAreaTriggerSet; typedef std::set GameObjectForQuestSet; diff --git a/src/game/Pet.h b/src/game/Pet.h index 32a8b9db6ae..ea13bd5d0dc 100644 --- a/src/game/Pet.h +++ b/src/game/Pet.h @@ -115,7 +115,7 @@ enum PetNameInvalidReason PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 16 }; -typedef HM_NAMESPACE::hash_map PetSpellMap; +typedef UNORDERED_MAP PetSpellMap; typedef std::map TeachSpellMap; typedef std::vector AutoSpellList; diff --git a/src/game/Player.h b/src/game/Player.h index 2e8de5e5823..9083f35cda1 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -91,7 +91,7 @@ struct SpellModifier Spell const* lastAffected; }; -typedef HM_NAMESPACE::hash_map PlayerSpellMap; +typedef UNORDERED_MAP PlayerSpellMap; typedef std::list SpellModList; struct SpellCooldown @@ -1366,7 +1366,7 @@ class TRINITY_DLL_SPEC Player : public Unit uint8 unReadMails; time_t m_nextMailDelivereTime; - typedef HM_NAMESPACE::hash_map ItemMap; + typedef UNORDERED_MAP ItemMap; ItemMap mMitems; //template defined in objectmgr.cpp @@ -2024,7 +2024,7 @@ class TRINITY_DLL_SPEC Player : public Unit /*** INSTANCE SYSTEM ***/ /*********************************************************/ - typedef HM_NAMESPACE::hash_map< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap; + typedef UNORDERED_MAP< uint32 /*mapId*/, InstancePlayerBind > BoundInstancesMap; void UpdateHomebindTime(uint32 time); diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp index 7167d25883b..2a1c6ec9d82 100644 --- a/src/game/SkillDiscovery.cpp +++ b/src/game/SkillDiscovery.cpp @@ -42,7 +42,7 @@ struct SkillDiscoveryEntry }; typedef std::list SkillDiscoveryList; -typedef HM_NAMESPACE::hash_map SkillDiscoveryMap; +typedef UNORDERED_MAP SkillDiscoveryMap; static SkillDiscoveryMap SkillDiscoveryStore; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 1a13b73194b..6b00240ac74 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -28,7 +28,7 @@ #include "Database/DBCStructure.h" #include "Database/SQLStorage.h" -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include class Player; @@ -492,7 +492,7 @@ struct SpellProcEventEntry uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_ }; -typedef HM_NAMESPACE::hash_map SpellProcEventMap; +typedef UNORDERED_MAP SpellProcEventMap; #define ELIXIR_BATTLE_MASK 0x1 #define ELIXIR_GUARDIAN_MASK 0x2 @@ -531,7 +531,7 @@ struct SpellTargetPosition float target_Orientation; }; -typedef HM_NAMESPACE::hash_map SpellTargetPositionMap; +typedef UNORDERED_MAP SpellTargetPositionMap; // Spell pet auras class PetAura @@ -594,7 +594,7 @@ struct SpellChainNode uint8 rank; }; -typedef HM_NAMESPACE::hash_map SpellChainMap; +typedef UNORDERED_MAP SpellChainMap; typedef std::multimap SpellChainMapNext; // Spell learning properties (accessed using SpellMgr functions) diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h index 10d9a4a6fa0..2fdf5622c2e 100644 --- a/src/game/WaypointManager.h +++ b/src/game/WaypointManager.h @@ -23,7 +23,7 @@ #include #include -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" struct WaypointBehavior { @@ -82,7 +82,7 @@ class WaypointManager void _addNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); void _clearPath(WaypointPath &path); - typedef HM_NAMESPACE::hash_map WaypointPathMap; + typedef UNORDERED_MAP WaypointPathMap; WaypointPathMap m_pathMap; }; diff --git a/src/game/World.h b/src/game/World.h index a42aa13d69f..b42a4d61394 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -504,9 +504,9 @@ class World uint32 mail_timer; uint32 mail_timer_expires; - typedef HM_NAMESPACE::hash_map WeatherMap; + typedef UNORDERED_MAP WeatherMap; WeatherMap m_weathers; - typedef HM_NAMESPACE::hash_map SessionMap; + typedef UNORDERED_MAP SessionMap; SessionMap m_sessions; std::set m_kicked_sessions; uint32 m_maxActiveSessionCount; diff --git a/src/shared/Common.h b/src/shared/Common.h index 34a35800ad2..9bf44b78f16 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -83,7 +83,7 @@ #endif // __SHOW_STUPID_WARNINGS__ #endif // __GNUC__ -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include #include #include diff --git a/src/shared/Database/Database.h b/src/shared/Database/Database.h index 1b9968da720..dc3eb174727 100644 --- a/src/shared/Database/Database.h +++ b/src/shared/Database/Database.h @@ -23,15 +23,15 @@ #include "zthread/Thread.h" #include "../src/zthread/ThreadImpl.h" -#include "Utilities/HashMap.h" +#include "Utilities/UnorderedMap.h" #include "Database/SqlDelayThread.h" class SqlTransaction; class SqlResultQueue; class SqlQueryHolder; -typedef HM_NAMESPACE::hash_map TransactionQueues; -typedef HM_NAMESPACE::hash_map QueryQueues; +typedef UNORDERED_MAP TransactionQueues; +typedef UNORDERED_MAP QueryQueues; #define MAX_QUERY_LEN 1024 diff --git a/win/VC71/framework.vcproj b/win/VC71/framework.vcproj index a1aa5a29002..519c8f48168 100644 --- a/win/VC71/framework.vcproj +++ b/win/VC71/framework.vcproj @@ -190,7 +190,7 @@ RelativePath="..\..\src\framework\Utilities\EventProcessor.h"> + RelativePath="..\..\src\framework\Utilities\UnorderedMap.h"> diff --git a/win/VC80/framework.vcproj b/win/VC80/framework.vcproj index 581235c5420..9b41a66926e 100644 --- a/win/VC80/framework.vcproj +++ b/win/VC80/framework.vcproj @@ -418,7 +418,7 @@ >