TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RefManager< TO, FROM > Class Template Reference

#include <RefManager.h>

Public Types

typedef
LinkedListHead::Iterator
< Reference< TO, FROM > > 
iterator
 
- Public Types inherited from LinkedListHead
typedef Iterator
< LinkedListElement
iterator
 

Public Member Functions

 RefManager ()
 
virtual ~RefManager ()
 
Reference< TO, FROM > * getFirst ()
 
Reference< TO, FROM > constgetFirst () const
 
Reference< TO, FROM > * getLast ()
 
Reference< TO, FROM > constgetLast () const
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
void clearReferences ()
 
- Public Member Functions inherited from LinkedListHead
 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 ()
 

Member Typedef Documentation

template<class TO, class FROM>
typedef LinkedListHead::Iterator< Reference<TO, FROM> > RefManager< TO, FROM >::iterator

Constructor & Destructor Documentation

template<class TO, class FROM>
RefManager< TO, FROM >::RefManager ( )
inline
30 { }
template<class TO, class FROM>
virtual RefManager< TO, FROM >::~RefManager ( )
inlinevirtual
31 { clearReferences(); }
void clearReferences()
Definition: RefManager.h:43

Member Function Documentation

template<class TO, class FROM>
iterator RefManager< TO, FROM >::begin ( )
inline
38 { return iterator(getFirst()); }
Reference< TO, FROM > * getFirst()
Definition: RefManager.h:33
LinkedListHead::Iterator< Reference< TO, FROM > > iterator
Definition: RefManager.h:29
template<class TO, class FROM>
void RefManager< TO, FROM >::clearReferences ( )
inline
44  {
45  LinkedListElement* ref;
46  while ((ref = getFirst()) != NULL)
47  {
48  ((Reference<TO, FROM>*) ref)->invalidate();
49  ref->delink(); // the delink might be already done by invalidate(), but doing it here again does not hurt and insures an empty list
50  }
51  }
Definition: LinkedList.h:28
arena_t NULL
Definition: jemalloc_internal.h:624
void delink()
Definition: LinkedList.h:53
Definition: Reference.h:27
Reference< TO, FROM > * getFirst()
Definition: RefManager.h:33

+ Here is the caller graph for this function:

template<class TO, class FROM>
iterator RefManager< TO, FROM >::end ( )
inline
39 { return iterator(NULL); }
arena_t NULL
Definition: jemalloc_internal.h:624
LinkedListHead::Iterator< Reference< TO, FROM > > iterator
Definition: RefManager.h:29
template<class TO, class FROM>
Reference<TO, FROM>* RefManager< TO, FROM >::getFirst ( )
inline
LinkedListElement * getFirst()
Definition: LinkedList.h:104
Definition: Reference.h:27

+ Here is the caller graph for this function:

template<class TO, class FROM>
Reference<TO, FROM> const* RefManager< TO, FROM >::getFirst ( ) const
inline
34 { return ((Reference<TO, FROM> const*) LinkedListHead::getFirst()); }
LinkedListElement * getFirst()
Definition: LinkedList.h:104
Definition: Reference.h:27
template<class TO, class FROM>
Reference<TO, FROM>* RefManager< TO, FROM >::getLast ( )
inline
LinkedListElement * getLast()
Definition: LinkedList.h:107
Definition: Reference.h:27

+ Here is the caller graph for this function:

template<class TO, class FROM>
Reference<TO, FROM> const* RefManager< TO, FROM >::getLast ( ) const
inline
36 { return ((Reference<TO, FROM> const*) LinkedListHead::getLast()); }
LinkedListElement * getLast()
Definition: LinkedList.h:107
Definition: Reference.h:27
template<class TO, class FROM>
iterator RefManager< TO, FROM >::rbegin ( )
inline
40 { return iterator(getLast()); }
Reference< TO, FROM > * getLast()
Definition: RefManager.h:35
LinkedListHead::Iterator< Reference< TO, FROM > > iterator
Definition: RefManager.h:29
template<class TO, class FROM>
iterator RefManager< TO, FROM >::rend ( )
inline
41 { return iterator(NULL); }
arena_t NULL
Definition: jemalloc_internal.h:624
LinkedListHead::Iterator< Reference< TO, FROM > > iterator
Definition: RefManager.h:29

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