TrinityCore
Loading...
Searching...
No Matches
Reference< TO, FROM > Class Template Referenceabstract

#include <Reference.h>

Public Member Functions

 Reference ()
 
virtual ~Reference ()
 
void link (TO *toObj, FROM *fromObj)
 
void unlink ()
 
void invalidate ()
 
bool isValid () const
 
Reference< TO, FROM > * next ()
 
Reference< TO, FROM > const * next () const
 
Reference< TO, FROM > * prev ()
 
Reference< TO, FROM > const * prev () const
 
Reference< TO, FROM > * nocheck_next ()
 
Reference< TO, FROM > const * nocheck_next () const
 
Reference< TO, FROM > * nocheck_prev ()
 
Reference< TO, FROM > const * nocheck_prev () const
 
TO * operator-> () const
 
TO * getTarget () const
 
FROM * GetSource () const
 
- Public Member Functions inherited from LinkedListElement
 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)
 

Protected Member Functions

virtual void targetObjectBuildLink ()=0
 
virtual void targetObjectDestroyLink ()=0
 
virtual void sourceObjectDestroyLink ()=0
 
- Protected Member Functions inherited from LinkedListElement
 ~LinkedListElement ()
 

Private Member Functions

 Reference (Reference const &)=delete
 
Referenceoperator= (Reference const &)=delete
 

Private Attributes

TO * iRefTo
 
FROM * iRefFrom
 

Detailed Description

template<class TO, class FROM>
class Reference< TO, FROM >

Definition at line 26 of file Reference.h.

Constructor & Destructor Documentation

◆ Reference() [1/2]

template<class TO , class FROM >
Reference< TO, FROM >::Reference ( )
inline

Definition at line 42 of file Reference.h.

42{ iRefTo = nullptr; iRefFrom = nullptr; }
TO * iRefTo
Definition: Reference.h:29
FROM * iRefFrom
Definition: Reference.h:30

◆ ~Reference()

template<class TO , class FROM >
virtual Reference< TO, FROM >::~Reference ( )
inlinevirtual

Definition at line 43 of file Reference.h.

43{ }

◆ Reference() [2/2]

template<class TO , class FROM >
Reference< TO, FROM >::Reference ( Reference< TO, FROM > const &  )
privatedelete

Member Function Documentation

◆ GetSource()

template<class TO , class FROM >
FROM * Reference< TO, FROM >::GetSource ( ) const
inline

Definition at line 96 of file Reference.h.

96{ return iRefFrom; }
+ Here is the caller graph for this function:

◆ getTarget()

template<class TO , class FROM >
TO * Reference< TO, FROM >::getTarget ( ) const
inline

Definition at line 94 of file Reference.h.

94{ return iRefTo; }
+ Here is the caller graph for this function:

◆ invalidate()

template<class TO , class FROM >
void Reference< TO, FROM >::invalidate ( )
inline

Definition at line 71 of file Reference.h.

72 {
74 delink();
75 iRefTo = nullptr;
76 }
virtual void sourceObjectDestroyLink()=0
+ Here is the call graph for this function:

◆ isValid()

template<class TO , class FROM >
bool Reference< TO, FROM >::isValid ( ) const
inline

Definition at line 78 of file Reference.h.

79 {
80 return iRefTo != nullptr;
81 }
+ Here is the caller graph for this function:

◆ link()

template<class TO , class FROM >
void Reference< TO, FROM >::link ( TO *  toObj,
FROM *  fromObj 
)
inline

Definition at line 46 of file Reference.h.

47 {
48 ASSERT(fromObj); // fromObj MUST not be NULL
49 if (isValid())
50 unlink();
51 if (toObj != nullptr)
52 {
53 iRefTo = toObj;
54 iRefFrom = fromObj;
56 }
57 }
#define ASSERT
Definition: Errors.h:68
void unlink()
Definition: Reference.h:61
bool isValid() const
Definition: Reference.h:78
virtual void targetObjectBuildLink()=0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next() [1/2]

template<class TO , class FROM >
Reference< TO, FROM > * Reference< TO, FROM >::next ( )
inline

Definition at line 83 of file Reference.h.

LinkedListElement * next()
Definition: LinkedList.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next() [2/2]

template<class TO , class FROM >
Reference< TO, FROM > const * Reference< TO, FROM >::next ( ) const
inline

Definition at line 84 of file Reference.h.

84{ return((Reference<TO, FROM> const*) LinkedListElement::next()); }
+ Here is the call graph for this function:

◆ nocheck_next() [1/2]

template<class TO , class FROM >
Reference< TO, FROM > * Reference< TO, FROM >::nocheck_next ( )
inline

Definition at line 88 of file Reference.h.

LinkedListElement * nocheck_next()
Definition: LinkedList.h:47
+ Here is the call graph for this function:

◆ nocheck_next() [2/2]

template<class TO , class FROM >
Reference< TO, FROM > const * Reference< TO, FROM >::nocheck_next ( ) const
inline

Definition at line 89 of file Reference.h.

+ Here is the call graph for this function:

◆ nocheck_prev() [1/2]

template<class TO , class FROM >
Reference< TO, FROM > * Reference< TO, FROM >::nocheck_prev ( )
inline

Definition at line 90 of file Reference.h.

LinkedListElement * nocheck_prev()
Definition: LinkedList.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nocheck_prev() [2/2]

template<class TO , class FROM >
Reference< TO, FROM > const * Reference< TO, FROM >::nocheck_prev ( ) const
inline

Definition at line 91 of file Reference.h.

+ Here is the call graph for this function:

◆ operator->()

template<class TO , class FROM >
TO * Reference< TO, FROM >::operator-> ( ) const
inline

Definition at line 93 of file Reference.h.

93{ return iRefTo; }

◆ operator=()

template<class TO , class FROM >
Reference & Reference< TO, FROM >::operator= ( Reference< TO, FROM > const &  )
privatedelete

◆ prev() [1/2]

template<class TO , class FROM >
Reference< TO, FROM > * Reference< TO, FROM >::prev ( )
inline

Definition at line 85 of file Reference.h.

LinkedListElement * prev()
Definition: LinkedList.h:44
+ Here is the call graph for this function:

◆ prev() [2/2]

template<class TO , class FROM >
Reference< TO, FROM > const * Reference< TO, FROM >::prev ( ) const
inline

Definition at line 86 of file Reference.h.

86{ return((Reference<TO, FROM> const*) LinkedListElement::prev()); }
+ Here is the call graph for this function:

◆ sourceObjectDestroyLink()

template<class TO , class FROM >
virtual void Reference< TO, FROM >::sourceObjectDestroyLink ( )
protectedpure virtual

◆ targetObjectBuildLink()

template<class TO , class FROM >
virtual void Reference< TO, FROM >::targetObjectBuildLink ( )
protectedpure virtual

◆ targetObjectDestroyLink()

template<class TO , class FROM >
virtual void Reference< TO, FROM >::targetObjectDestroyLink ( )
protectedpure virtual

◆ unlink()

template<class TO , class FROM >
void Reference< TO, FROM >::unlink ( )
inline

Definition at line 61 of file Reference.h.

62 {
64 delink();
65 iRefTo = nullptr;
66 iRefFrom = nullptr;
67 }
virtual void targetObjectDestroyLink()=0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ iRefFrom

template<class TO , class FROM >
FROM* Reference< TO, FROM >::iRefFrom
private

Definition at line 30 of file Reference.h.

◆ iRefTo

template<class TO , class FROM >
TO* Reference< TO, FROM >::iRefTo
private

Definition at line 29 of file Reference.h.


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