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

#include "LinkedList.h"

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

Public Member Functions

 LinkedListElement ()=default
 
 ~LinkedListElement ()
 
bool hasNext () const
 
bool hasPrev () const
 
bool isInList () const
 
LinkedListElementnext ()
 
LinkedListElement const * next () const
 
LinkedListElementprev ()
 
LinkedListElement const * prev () const
 
LinkedListElementnocheck_next ()
 
LinkedListElement const * nocheck_next () const
 
LinkedListElementnocheck_prev ()
 
LinkedListElement const * nocheck_prev () const
 
void delink ()
 
void insertBefore (LinkedListElement *pElem)
 
void insertAfter (LinkedListElement *pElem)
 

Private Attributes

LinkedListElementiNext {nullptr}
 
LinkedListElementiPrev {nullptr}
 

Friends

class LinkedListHead
 

Detailed Description

Constructor & Destructor Documentation

◆ LinkedListElement()

LinkedListElement::LinkedListElement ( )
default

◆ ~LinkedListElement()

LinkedListElement::~LinkedListElement ( )
inline
36{ delink(); }
void delink()
Definition: LinkedList.h:52

References delink().

Member Function Documentation

◆ delink()

void LinkedListElement::delink ( )
inline
53 {
54 if (isInList())
55 {
56 iNext->iPrev = iPrev;
57 iPrev->iNext = iNext;
58 iNext = nullptr;
59 iPrev = nullptr;
60 }
61 }
LinkedListElement * iPrev
Definition: LinkedList.h:33
bool isInList() const
Definition: LinkedList.h:40
LinkedListElement * iNext
Definition: LinkedList.h:32

References iNext, iPrev, and isInList().

Referenced by RefMgr< TO, FROM >::clearReferences(), Reference< TO, FROM >::invalidate(), Reference< TO, FROM >::unlink(), and ~LinkedListElement().

◆ hasNext()

bool LinkedListElement::hasNext ( ) const
inline
38{ return (iNext && iNext->iNext != nullptr); }

References iNext.

Referenced by next().

◆ hasPrev()

bool LinkedListElement::hasPrev ( ) const
inline
39{ return (iPrev && iPrev->iPrev != nullptr); }

References iPrev.

Referenced by prev().

◆ insertAfter()

void LinkedListElement::insertAfter ( LinkedListElement pElem)
inline
72 {
73 pElem->iPrev = this;
74 pElem->iNext = iNext;
75 iNext->iPrev = pElem;
76 iNext = pElem;
77 }

References iNext, and iPrev.

Referenced by LinkedListHead::insertFirst().

◆ insertBefore()

void LinkedListElement::insertBefore ( LinkedListElement pElem)
inline
64 {
65 pElem->iNext = this;
66 pElem->iPrev = iPrev;
67 iPrev->iNext = pElem;
68 iPrev = pElem;
69 }

References iNext, and iPrev.

Referenced by LinkedListHead::insertLast().

◆ isInList()

bool LinkedListElement::isInList ( ) const
inline
40{ return (iNext != nullptr && iPrev != nullptr); }

References iNext, and iPrev.

Referenced by delink(), and LinkedListHead::IsEmpty().

◆ next() [1/2]

LinkedListElement * LinkedListElement::next ( )
inline
42{ return hasNext() ? iNext : nullptr; }
bool hasNext() const
Definition: LinkedList.h:38

References hasNext(), and iNext.

Referenced by LinkedListHead::getSize(), and Reference< TO, FROM >::next().

◆ next() [2/2]

LinkedListElement const * LinkedListElement::next ( ) const
inline
43{ return hasNext() ? iNext : nullptr; }

References hasNext(), and iNext.

◆ nocheck_next() [1/2]

LinkedListElement * LinkedListElement::nocheck_next ( )
inline
47{ return iNext; }

References iNext.

Referenced by Reference< TO, FROM >::nocheck_next().

◆ nocheck_next() [2/2]

LinkedListElement const * LinkedListElement::nocheck_next ( ) const
inline
48{ return iNext; }

References iNext.

◆ nocheck_prev() [1/2]

LinkedListElement * LinkedListElement::nocheck_prev ( )
inline
49{ return iPrev; }

References iPrev.

Referenced by Reference< TO, FROM >::nocheck_prev().

◆ nocheck_prev() [2/2]

LinkedListElement const * LinkedListElement::nocheck_prev ( ) const
inline
50{ return iPrev; }

References iPrev.

◆ prev() [1/2]

LinkedListElement * LinkedListElement::prev ( )
inline
44{ return hasPrev() ? iPrev : nullptr; }
bool hasPrev() const
Definition: LinkedList.h:39

References hasPrev(), and iPrev.

Referenced by Reference< TO, FROM >::prev().

◆ prev() [2/2]

LinkedListElement const * LinkedListElement::prev ( ) const
inline
45{ return hasPrev() ? iPrev : nullptr; }

References hasPrev(), and iPrev.

Friends And Related Function Documentation

◆ LinkedListHead

friend class LinkedListHead
friend

Member Data Documentation

◆ iNext

◆ iPrev