mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[6855] Fixed the MapReference loop on map update by storing the iterator in the map.
This commit is contained in:
parent
316acd590c
commit
8b707ca072
6 changed files with 54 additions and 14 deletions
|
|
@ -44,6 +44,11 @@ class LinkedListElement
|
|||
LinkedListElement * prev() { return hasPrev() ? iPrev : NULL; }
|
||||
LinkedListElement const* prev() const { return hasPrev() ? iPrev : NULL; }
|
||||
|
||||
LinkedListElement * nocheck_next() { return iNext; }
|
||||
LinkedListElement const* nocheck_next() const { return iNext; }
|
||||
LinkedListElement * nocheck_prev() { return iPrev; }
|
||||
LinkedListElement const* nocheck_prev() const { return iPrev; }
|
||||
|
||||
void delink()
|
||||
{
|
||||
if(isInList())
|
||||
|
|
@ -134,7 +139,10 @@ class LinkedListHead
|
|||
typedef ptrdiff_t difference_type;
|
||||
typedef ptrdiff_t distance_type;
|
||||
typedef _Ty* pointer;
|
||||
typedef _Ty const* const_pointer;
|
||||
typedef _Ty& reference;
|
||||
typedef _Ty const & const_reference;
|
||||
|
||||
|
||||
Iterator() : _Ptr(0)
|
||||
{ // construct with null node pointer
|
||||
|
|
@ -144,6 +152,17 @@ class LinkedListHead
|
|||
{ // construct with node pointer _Pnode
|
||||
}
|
||||
|
||||
Iterator& operator=(Iterator const &_Right)
|
||||
{
|
||||
return (*this) = _Right._Ptr;
|
||||
}
|
||||
|
||||
Iterator& operator=(const_pointer const &_Right)
|
||||
{
|
||||
_Ptr = (pointer)_Right;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
reference operator*()
|
||||
{ // return designated value
|
||||
return *_Ptr;
|
||||
|
|
@ -200,6 +219,17 @@ class LinkedListHead
|
|||
return (!(*this == _Right));
|
||||
}
|
||||
|
||||
bool operator==(const_reference _Right) const
|
||||
{ // test for reference equality
|
||||
return (_Ptr == &_Right);
|
||||
}
|
||||
|
||||
bool operator!=(const_reference _Right) const
|
||||
{ // test for reference equality
|
||||
return (_Ptr != &_Right));
|
||||
}
|
||||
|
||||
|
||||
pointer _Mynode()
|
||||
{ // return node pointer
|
||||
return (_Ptr);
|
||||
|
|
|
|||
|
|
@ -71,9 +71,15 @@ template <class TO, class FROM> class Reference : public LinkedListElement
|
|||
return iRefTo != NULL;
|
||||
}
|
||||
|
||||
Reference<TO,FROM>* next() { return((Reference<TO,FROM>*)LinkedListElement::next()); }
|
||||
Reference<TO,FROM>const* next() const { return((Reference<TO,FROM> const*)LinkedListElement::next()); }
|
||||
Reference<TO,FROM>* prev() { return((Reference<TO,FROM>*)LinkedListElement::prev()); }
|
||||
Reference<TO,FROM> * next() { return((Reference<TO,FROM> *) LinkedListElement::next()); }
|
||||
Reference<TO,FROM> const * next() const { return((Reference<TO,FROM> const *) LinkedListElement::next()); }
|
||||
Reference<TO,FROM> * prev() { return((Reference<TO,FROM> *) LinkedListElement::prev()); }
|
||||
Reference<TO,FROM> const * prev() const { return((Reference<TO,FROM> const *) LinkedListElement::prev()); }
|
||||
|
||||
Reference<TO,FROM> * nocheck_next() { return((Reference<TO,FROM> *) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO,FROM> const * nocheck_next() const { return((Reference<TO,FROM> const *) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO,FROM> * nocheck_prev() { return((Reference<TO,FROM> *) LinkedListElement::nocheck_prev()); }
|
||||
Reference<TO,FROM> const * nocheck_prev() const { return((Reference<TO,FROM> const *) LinkedListElement::nocheck_prev()); }
|
||||
|
||||
inline TO* operator ->() const { return iRefTo; }
|
||||
inline TO* getTarget() const { return iRefTo; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue