diff options
Diffstat (limited to 'src/framework/Utilities')
-rw-r--r-- | src/framework/Utilities/LinkedList.h | 30 | ||||
-rw-r--r-- | src/framework/Utilities/LinkedReference/Reference.h | 12 |
2 files changed, 39 insertions, 3 deletions
diff --git a/src/framework/Utilities/LinkedList.h b/src/framework/Utilities/LinkedList.h index fe4d1b7dd8d..3f9c99b31ff 100644 --- a/src/framework/Utilities/LinkedList.h +++ b/src/framework/Utilities/LinkedList.h @@ -46,6 +46,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()) @@ -136,7 +141,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 @@ -146,6 +154,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; @@ -202,6 +221,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); diff --git a/src/framework/Utilities/LinkedReference/Reference.h b/src/framework/Utilities/LinkedReference/Reference.h index ca837c81f91..bce0e0f387c 100644 --- a/src/framework/Utilities/LinkedReference/Reference.h +++ b/src/framework/Utilities/LinkedReference/Reference.h @@ -73,9 +73,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; } |