AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
LinkedListHead Class Reference

#include "LinkedList.h"

Inheritance diagram for LinkedListHead:
RefMgr< GridRefMgr< Corpse >, Corpse > RefMgr< GridRefMgr< Creature >, Creature > RefMgr< GridRefMgr< DynamicObject >, DynamicObject > RefMgr< Unit, TargetedMovementGeneratorBase > RefMgr< GridRefMgr< GameObject >, GameObject > RefMgr< GridRefMgr< OBJECT >, OBJECT > RefMgr< Group, Player > RefMgr< Unit, ThreatMgr > RefMgr< Loot, LootValidatorRef > RefMgr< GridRefMgr< NGridType >, NGridType > RefMgr< Map, Player > RefMgr< GridRefMgr< Player >, Player > RefMgr< GridRefMgr< T >, T > RefMgr< GridRefMgr< H >, H > RefMgr< GridRefMgr< GRID_OBJECT_TYPES >, GRID_OBJECT_TYPES > RefMgr< GridRefMgr< WORLD_OBJECT_TYPES >, WORLD_OBJECT_TYPES > RefMgr< GridRefMgr< NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > >, NGrid< N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES > > RefMgr< GridRefMgr< OBJECT_TYPES >, OBJECT_TYPES > RefMgr< TO, FROM >

Classes

class  Iterator
 

Public Types

typedef Iterator< LinkedListElementiterator
 

Public Member Functions

 LinkedListHead ()
 
bool IsEmpty () const
 
LinkedListElementgetFirst ()
 
LinkedListElement const * getFirst () const
 
LinkedListElementgetLast ()
 
LinkedListElement const * getLast () const
 
void insertFirst (LinkedListElement *pElem)
 
void insertLast (LinkedListElement *pElem)
 
uint32 getSize () const
 
void incSize ()
 
void decSize ()
 

Private Attributes

LinkedListElement iFirst
 
LinkedListElement iLast
 
uint32 iSize {0}
 

Detailed Description

Member Typedef Documentation

◆ iterator

Constructor & Destructor Documentation

◆ LinkedListHead()

LinkedListHead::LinkedListHead ( )
inline
90 {
91 // create empty list
92
95 }
LinkedListElement * iPrev
Definition: LinkedList.h:33
LinkedListElement * iNext
Definition: LinkedList.h:32
LinkedListElement iLast
Definition: LinkedList.h:86
LinkedListElement iFirst
Definition: LinkedList.h:85

References iFirst, iLast, LinkedListElement::iNext, and LinkedListElement::iPrev.

Member Function Documentation

◆ decSize()

void LinkedListHead::decSize ( )
inline
135{ --iSize; }
uint32 iSize
Definition: LinkedList.h:87

References iSize.

Referenced by MapReference::sourceObjectDestroyLink(), and MapReference::targetObjectDestroyLink().

◆ getFirst() [1/2]

LinkedListElement * LinkedListHead::getFirst ( )
inline
99{ return (IsEmpty() ? nullptr : iFirst.iNext); }
bool IsEmpty() const
Definition: LinkedList.h:97

References iFirst, LinkedListElement::iNext, and IsEmpty().

Referenced by RefMgr< TO, FROM >::getFirst(), and getSize().

◆ getFirst() [2/2]

LinkedListElement const * LinkedListHead::getFirst ( ) const
inline
100{ return (IsEmpty() ? nullptr : iFirst.iNext); }

References iFirst, LinkedListElement::iNext, and IsEmpty().

◆ getLast() [1/2]

LinkedListElement * LinkedListHead::getLast ( )
inline
102{ return (IsEmpty() ? nullptr : iLast.iPrev); }

References iLast, LinkedListElement::iPrev, and IsEmpty().

Referenced by RefMgr< TO, FROM >::getLast().

◆ getLast() [2/2]

LinkedListElement const * LinkedListHead::getLast ( ) const
inline
103{ return (IsEmpty() ? nullptr : iLast.iPrev); }

References iLast, LinkedListElement::iPrev, and IsEmpty().

◆ getSize()

uint32 LinkedListHead::getSize ( ) const
inline
116 {
117 if (!iSize)
118 {
119 uint32 result = 0;
120 LinkedListElement const* e = getFirst();
121 while (e)
122 {
123 ++result;
124 e = e->next();
125 }
126 return result;
127 }
128 else
129 {
130 return iSize;
131 }
132 }
std::uint32_t uint32
Definition: Define.h:108
Definition: LinkedList.h:28
LinkedListElement * next()
Definition: LinkedList.h:42
LinkedListElement * getFirst()
Definition: LinkedList.h:99

References getFirst(), iSize, and LinkedListElement::next().

Referenced by spell_yogg_saron_brain_link::spell_yogg_saron_brain_link_AuraScript::HandleOnEffectApply(), Group::RemoveMember(), boss_yoggsaron_constrictor_tentacle::boss_yoggsaron_constrictor_tentacleAI::SelectConstrictTarget(), boss_yoggsaron_corruptor_tentacle::boss_yoggsaron_corruptor_tentacleAI::SelectCorruptionTarget(), boss_thorim_arena_npcs::boss_thorim_arena_npcsAI::SelectT(), HostileRefMgr::threatAssist(), and boss_twin_valkyrAI::UpdateAI().

◆ incSize()

void LinkedListHead::incSize ( )
inline
134{ ++iSize; }

References iSize.

Referenced by MapReference::targetObjectBuildLink().

◆ insertFirst()

void LinkedListHead::insertFirst ( LinkedListElement pElem)
inline
106 {
107 iFirst.insertAfter(pElem);
108 }
void insertAfter(LinkedListElement *pElem)
Definition: LinkedList.h:71

References iFirst, and LinkedListElement::insertAfter().

Referenced by Unit::addFollower(), Unit::addHatedBy(), Loot::addLootValidatorRef(), Group::LinkMember(), and MapReference::targetObjectBuildLink().

◆ insertLast()

void LinkedListHead::insertLast ( LinkedListElement pElem)
inline
111 {
112 iLast.insertBefore(pElem);
113 }
void insertBefore(LinkedListElement *pElem)
Definition: LinkedList.h:63

References iLast, and LinkedListElement::insertBefore().

◆ IsEmpty()

bool LinkedListHead::IsEmpty ( ) const
inline
97{ return (!iFirst.iNext->isInList()); }
bool isInList() const
Definition: LinkedList.h:40

References iFirst, LinkedListElement::iNext, and LinkedListElement::isInList().

Referenced by Map::AddToMap(), MotionTransport::BuildUpdate(), StaticTransport::BuildUpdate(), InstanceMap::CannotEnter(), boss_gothik::boss_gothikAI::CheckGroupSplitted(), instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::ChromieWhisper(), brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_arthas::npc_arthasAI::DoAction(), ScriptedAI::DoPlayMusic(), InstanceScript::DoSendNotifyToInstance(), InstanceScript::DoUpdateWorldState(), CreatureAI::DoZoneInCombat(), boss_sapphiron::boss_sapphironAI::EnterCombatSelfFunction(), instance_pit_of_saron::instance_pit_of_saron_InstanceScript::GetCreatureEntry(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::GetCreatureEntry(), getFirst(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::GetGameObjectEntry(), getLast(), instance_sunwell_plateau::instance_sunwell_plateau_InstanceMapScript::GetPlayerInMap(), WorldSession::HandleMoveWorldportAck(), Map::HavePlayers(), boss_ichoron::boss_ichoronAI::IchoronDoCastToAllHostilePlayers(), boss_apothecary_hummel::boss_apothecary_hummelAI::JustDied(), npc_coren_direbrew::JustDied(), boss_headless_horseman::JustDied(), boss_four_horsemen::boss_four_horsemenAI::JustDied(), WorldSession::LogoutPlayer(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::OnCreatureCreate(), instance_forge_of_souls::instance_forge_of_souls_InstanceScript::OnCreatureCreate(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::OnCreatureCreate(), instance_pit_of_saron::instance_pit_of_saron_InstanceScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), instance_nexus::instance_nexus_InstanceMapScript::OnCreatureCreate(), instance_shattered_halls::instance_shattered_halls_InstanceMapScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnGameObjectCreate(), Map::PlayDirectSoundToMap(), SmartScript::ProcessAction(), Map::RemoveFromMap(), instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::ReplaceMoiraIfSaved(), InstanceMap::Reset(), SendPacketToPlayers(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::SendUpdateWorldState(), instance_hyjal::instance_mount_hyjal_InstanceMapScript::SetData(), instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::SetData(), Map::SetZoneMusic(), Map::SetZoneOverrideLight(), Map::SetZoneWeather(), instance_zulaman::instance_zulaman_InstanceMapScript::SummonHostage(), npc_arthas::npc_arthasAI::SummonNextWave(), instance_stratholme::instance_stratholme_InstanceMapScript::Update(), instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Update(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::Update(), instance_vault_of_archavon::instance_vault_of_archavon_InstanceMapScript::Update(), Unit::Update(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), boss_cthun::UpdateAI(), boss_the_lich_king::boss_the_lich_kingAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), npc_scion_of_eternity::npc_scion_of_eternityAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateWorldState(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateWorldState(), and ObjectGridUnloader::Visit().

Member Data Documentation

◆ iFirst

LinkedListElement LinkedListHead::iFirst
private

◆ iLast

LinkedListElement LinkedListHead::iLast
private

Referenced by getLast(), insertLast(), and LinkedListHead().

◆ iSize

uint32 LinkedListHead::iSize {0}
private

Referenced by decSize(), getSize(), and incSize().