TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LinkedListHead Class Reference

#include <LinkedList.h>

Classes

class  Iterator
 

Public Types

typedef Iterator
< LinkedListElement
iterator
 

Public Member Functions

 LinkedListHead ()
 
virtual ~LinkedListHead ()
 
bool isEmpty () const
 
LinkedListElementgetFirst ()
 
LinkedListElement constgetFirst () const
 
LinkedListElementgetLast ()
 
LinkedListElement constgetLast () const
 
void insertFirst (LinkedListElement *pElem)
 
void insertLast (LinkedListElement *pElem)
 
uint32 getSize () const
 
void incSize ()
 
void decSize ()
 

Private Member Functions

 LinkedListHead (LinkedListHead const &)
 
LinkedListHeadoperator= (LinkedListHead const &)
 

Private Attributes

LinkedListElement iFirst
 
LinkedListElement iLast
 
uint32 iSize
 

Member Typedef Documentation

Constructor & Destructor Documentation

LinkedListHead::LinkedListHead ( )
inline
92  : iSize(0)
93  {
94  // create empty list
95 
96  iFirst.iNext = &iLast;
97  iLast.iPrev = &iFirst;
98  }
LinkedListElement iLast
Definition: LinkedList.h:88
LinkedListElement * iNext
Definition: LinkedList.h:33
uint32 iSize
Definition: LinkedList.h:89
LinkedListElement iFirst
Definition: LinkedList.h:87
LinkedListElement * iPrev
Definition: LinkedList.h:34
virtual LinkedListHead::~LinkedListHead ( )
inlinevirtual
100 { }
LinkedListHead::LinkedListHead ( LinkedListHead const )
private

Member Function Documentation

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

+ Here is the caller graph for this function:

LinkedListElement* LinkedListHead::getFirst ( )
inline
104 { return(isEmpty() ? NULL : iFirst.iNext); }
LinkedListElement * iNext
Definition: LinkedList.h:33
arena_t NULL
Definition: jemalloc_internal.h:624
LinkedListElement iFirst
Definition: LinkedList.h:87
bool isEmpty() const
Definition: LinkedList.h:102

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LinkedListElement const* LinkedListHead::getFirst ( ) const
inline
105 { return(isEmpty() ? NULL : iFirst.iNext); }
LinkedListElement * iNext
Definition: LinkedList.h:33
arena_t NULL
Definition: jemalloc_internal.h:624
LinkedListElement iFirst
Definition: LinkedList.h:87
bool isEmpty() const
Definition: LinkedList.h:102

+ Here is the call graph for this function:

LinkedListElement* LinkedListHead::getLast ( )
inline
107 { return(isEmpty() ? NULL : iLast.iPrev); }
LinkedListElement iLast
Definition: LinkedList.h:88
arena_t NULL
Definition: jemalloc_internal.h:624
bool isEmpty() const
Definition: LinkedList.h:102
LinkedListElement * iPrev
Definition: LinkedList.h:34

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LinkedListElement const* LinkedListHead::getLast ( ) const
inline
108 { return(isEmpty() ? NULL : iLast.iPrev); }
LinkedListElement iLast
Definition: LinkedList.h:88
arena_t NULL
Definition: jemalloc_internal.h:624
bool isEmpty() const
Definition: LinkedList.h:102
LinkedListElement * iPrev
Definition: LinkedList.h:34

+ Here is the call graph for this function:

uint32 LinkedListHead::getSize ( ) const
inline
121  {
122  if (!iSize)
123  {
124  uint32 result = 0;
125  LinkedListElement const* e = getFirst();
126  while (e)
127  {
128  ++result;
129  e = e->next();
130  }
131  return result;
132  }
133  else
134  return iSize;
135  }
Definition: LinkedList.h:28
LinkedListElement * getFirst()
Definition: LinkedList.h:104
LinkedListElement * next()
Definition: LinkedList.h:43
uint32 iSize
Definition: LinkedList.h:89
uint32_t uint32
Definition: Define.h:150

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void LinkedListHead::incSize ( )
inline
137 { ++iSize; }
uint32 iSize
Definition: LinkedList.h:89

+ Here is the caller graph for this function:

void LinkedListHead::insertFirst ( LinkedListElement pElem)
inline
111  {
112  iFirst.insertAfter(pElem);
113  }
LinkedListElement iFirst
Definition: LinkedList.h:87
void insertAfter(LinkedListElement *pElem)
Definition: LinkedList.h:69

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void LinkedListHead::insertLast ( LinkedListElement pElem)
inline
116  {
117  iLast.insertBefore(pElem);
118  }
LinkedListElement iLast
Definition: LinkedList.h:88
void insertBefore(LinkedListElement *pElem)
Definition: LinkedList.h:61

+ Here is the call graph for this function:

bool LinkedListHead::isEmpty ( ) const
inline
102 { return(!iFirst.iNext->isInList()); }
LinkedListElement * iNext
Definition: LinkedList.h:33
bool isInList() const
Definition: LinkedList.h:41
LinkedListElement iFirst
Definition: LinkedList.h:87

+ Here is the call graph for this function:

LinkedListHead& LinkedListHead::operator= ( LinkedListHead const )
private

Member Data Documentation

LinkedListElement LinkedListHead::iFirst
private
LinkedListElement LinkedListHead::iLast
private
uint32 LinkedListHead::iSize
private

The documentation for this class was generated from the following file: