Horizon Official Technical Documentation
|
|
#include <Reference.hpp>
Public Member Functions | |
Reference () | |
virtual | ~Reference () |
void | link (TO *toObj, FROM *fromObj) |
Links the Reference to the specified object by adding it to the front of the list. More... | |
void | remove () |
void | invalidate () |
bool | is_valid () 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 * | target () const |
FROM * | source () const |
![]() | |
Element () | |
bool | has_next () const |
Returns true if this Element has a next Element in the list. More... | |
bool | has_prev () const |
Returns true if this Element has a previous Element in the list. More... | |
bool | is_in_list () const |
Returns true if this Element is in a list. More... | |
Element * | next () |
Returns the next Element in the list. More... | |
Element const * | next () const |
Element * | prev () |
Returns the previous Element in the list. More... | |
Element const * | prev () const |
Element * | nocheck_next () |
Returns the next Element in the list without checking if it exists. More... | |
Element const * | nocheck_next () const |
Element * | nocheck_prev () |
Returns the previous Element in the list without checking if it exists. More... | |
Element const * | nocheck_prev () const |
void | delink () |
Removes this Element from the list. More... | |
void | push_before (Element *pElem) |
Pushes this Element before the given Element. More... | |
void | push_after (Element *pElem) |
Pushes this Element after the given Element. More... | |
Protected Member Functions | |
virtual void | target_object_build_link ()=0 |
virtual void | target_object_destroy_link ()=0 |
virtual void | source_object_destroy_link ()=0 |
![]() | |
~Element () | |
Private Member Functions | |
Reference (Reference const &)=delete | |
Reference & | operator= (Reference const &)=delete |
Private Attributes | |
TO * | _ref_to |
FROM * | _ref_from |
This class is used to manage a linked list of References. It is not intended to be used directly. It is used as a base class for other classes that need to manage a linked list. The Head class is a friend of this class (derived from Element) to allow it to access the private members of this class. The relationship between the Reference and the ReferenceManager is a one-to-many relationship, where the ReferenceManager is the one and the Reference is the many. The ReferenceManager is responsible for creating and destroying the Reference. The ReferenceManager is also responsible for calling the link() and remove() methods of the Reference. This creates a dynamic responsibility chain between the ReferenceManager and the Reference.
|
inline |
|
inlinevirtual |
|
privatedelete |
|
inline |
References Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_to, Horizon::Structures::LinkedList::Element::delink(), and Horizon::Structures::LinkedList::Reference< TO, FROM >::source_object_destroy_link().
Referenced by TestObject< T >::remove_reference().
|
inline |
References Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_to.
Referenced by Horizon::Zone::GridObject< T >::has_valid_grid_reference(), ReferenceObject< T >::is_valid(), Horizon::Structures::LinkedList::Reference< TO, FROM >::link(), and TestObject< T >::valid().
|
inline |
Links the Reference to the specified object by adding it to the front of the list.
toObj | The object to reference. |
fromObj | The object that is referencing. |
References Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_from, Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_to, Horizon::Structures::LinkedList::Reference< TO, FROM >::is_valid(), Horizon::Structures::LinkedList::Reference< TO, FROM >::remove(), and Horizon::Structures::LinkedList::Reference< TO, FROM >::target_object_build_link().
Referenced by Horizon::Zone::GridObject< T >::add_grid_reference(), TestObject< T >::add_reference(), and ReferenceObject< T >::add_reference().
|
inline |
References Horizon::Structures::LinkedList::Element::next().
|
inline |
References Horizon::Structures::LinkedList::Element::next().
|
inline |
References Horizon::Structures::LinkedList::Element::nocheck_next().
|
inline |
References Horizon::Structures::LinkedList::Element::nocheck_next().
|
inline |
References Horizon::Structures::LinkedList::Element::nocheck_prev().
|
inline |
References Horizon::Structures::LinkedList::Element::nocheck_prev().
|
inline |
|
privatedelete |
|
inline |
References Horizon::Structures::LinkedList::Element::prev().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
References Horizon::Structures::LinkedList::Element::prev().
|
inline |
References Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_from, Horizon::Structures::LinkedList::Reference< TO, FROM >::_ref_to, Horizon::Structures::LinkedList::Element::delink(), and Horizon::Structures::LinkedList::Reference< TO, FROM >::target_object_destroy_link().
Referenced by Horizon::Structures::LinkedList::Reference< TO, FROM >::link(), Horizon::Zone::GridObject< T >::remove_grid_reference(), and ReferenceObject< T >::remove_reference().
|
inline |
|
protectedpure virtual |
Implemented in GridReference< OBJECT >, GridReference< Elemental >, GridReference< Homunculus >, GridReference< Item >, GridReference< Mercenary >, GridReference< Monster >, GridReference< NPC >, GridReference< Pet >, GridReference< Player >, GridReference< Skill >, GridReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, TestReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, and TestReference< T >.
Referenced by Horizon::Structures::LinkedList::Reference< TO, FROM >::invalidate().
|
inline |
|
protectedpure virtual |
Implemented in GridReference< OBJECT >, GridReference< Elemental >, GridReference< Homunculus >, GridReference< Item >, GridReference< Mercenary >, GridReference< Monster >, GridReference< NPC >, GridReference< Pet >, GridReference< Player >, GridReference< Skill >, GridReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, TestReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, and TestReference< T >.
Referenced by Horizon::Structures::LinkedList::Reference< TO, FROM >::link().
|
protectedpure virtual |
Implemented in GridReference< OBJECT >, GridReference< Elemental >, GridReference< Homunculus >, GridReference< Item >, GridReference< Mercenary >, GridReference< Monster >, GridReference< NPC >, GridReference< Pet >, GridReference< Player >, GridReference< Skill >, GridReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, TestReference< T >, TestReference< OBJECT >, TestReference< A >, TestReference< B >, TestReference< C >, TestReference< Player >, and TestReference< T >.
Referenced by Horizon::Structures::LinkedList::Reference< TO, FROM >::remove().
|
private |
|
private |
Referenced by Horizon::Structures::LinkedList::Reference< TO, FROM >::invalidate(), Horizon::Structures::LinkedList::Reference< TO, FROM >::is_valid(), Horizon::Structures::LinkedList::Reference< TO, FROM >::link(), Horizon::Structures::LinkedList::Reference< TO, FROM >::operator->(), Horizon::Structures::LinkedList::Reference< TO, FROM >::Reference(), Horizon::Structures::LinkedList::Reference< TO, FROM >::remove(), and Horizon::Structures::LinkedList::Reference< TO, FROM >::target().