#include <IntrusiveDList.h>
Public Member Functions | |
IntrusiveTwoDListIter () | |
IntrusiveTwoDListIter (ElementT *list1, ElementT *list2) | |
virtual | ~IntrusiveTwoDListIter () |
void | operator++ () |
ReturnT * | operator-> () const |
operator ReturnT * () const | |
ReturnT & | operator * () const |
bool | operator== (IntrusiveTwoDListIter const &other) const |
Protected Member Functions | |
virtual ReturnT * | getReturnElement (ElementT *element) const=0 |
Returns a pointer to the return element corresponding to the element that the iterator is currently positioned at. | |
Private Attributes | |
ElementT * | curr |
Pointer to the current list element. | |
ElementT * | next |
Pointer to the start of the second list. | |
bool | processingNext |
True if the first list has been walked. |
The first list is walked followed by the second list. The lists can only be walked over in the forward direction.
Elements in both lists are all of the same type. A callback method must be defined that determines what should be returned for each element in the lists.
Definition at line 153 of file IntrusiveDList.h.
IntrusiveTwoDListIter< ElementT, ReturnT >::IntrusiveTwoDListIter | ( | ) | [inline, explicit] |
Definition at line 184 of file IntrusiveDList.h.
00185 { 00186 curr = NULL; 00187 next = NULL; 00188 processingNext = false; 00189 }
IntrusiveTwoDListIter< ElementT, ReturnT >::IntrusiveTwoDListIter | ( | ElementT * | list1, | |
ElementT * | list2 | |||
) | [inline, explicit] |
Definition at line 191 of file IntrusiveDList.h.
00192 { 00193 if (list1 == NULL) { 00194 curr = list2; 00195 processingNext = true; 00196 } else { 00197 curr = list1; 00198 next = list2; 00199 processingNext = false; 00200 } 00201 }
virtual IntrusiveTwoDListIter< ElementT, ReturnT >::~IntrusiveTwoDListIter | ( | ) | [inline, virtual] |
virtual ReturnT* IntrusiveTwoDListIter< ElementT, ReturnT >::getReturnElement | ( | ElementT * | element | ) | const [protected, pure virtual] |
Returns a pointer to the return element corresponding to the element that the iterator is currently positioned at.
element | the current element |
Implemented in TwoQPageListIter< PageT >, and TwoQDirtyPageListIter< PageT >.
Referenced by IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator *(), IntrusiveTwoDListIter< ElementT, ReturnT >::operator ReturnT *(), and IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator->().
void IntrusiveTwoDListIter< ElementT, ReturnT >::operator++ | ( | ) | [inline] |
Definition at line 207 of file IntrusiveDList.h.
00208 { 00209 curr = static_cast<ElementT *>(curr->getNext()); 00210 if (curr == NULL && !processingNext) { 00211 curr = next; 00212 processingNext = true; 00213 } 00214 }
ReturnT* IntrusiveTwoDListIter< ElementT, ReturnT >::operator-> | ( | ) | const [inline] |
Definition at line 216 of file IntrusiveDList.h.
00217 { 00218 return getReturnElement(curr); 00219 }
IntrusiveTwoDListIter< ElementT, ReturnT >::operator ReturnT * | ( | ) | const [inline] |
Definition at line 221 of file IntrusiveDList.h.
References IntrusiveTwoDListIter< ElementT, ReturnT >::curr, and IntrusiveTwoDListIter< ElementT, ReturnT >::getReturnElement().
00222 { 00223 return getReturnElement(curr); 00224 }
ReturnT& IntrusiveTwoDListIter< ElementT, ReturnT >::operator * | ( | ) | const [inline] |
Definition at line 226 of file IntrusiveDList.h.
00227 { 00228 return *(getReturnElement(curr)); 00229 }
bool IntrusiveTwoDListIter< ElementT, ReturnT >::operator== | ( | IntrusiveTwoDListIter< ElementT, ReturnT > const & | other | ) | const [inline] |
ElementT* IntrusiveTwoDListIter< ElementT, ReturnT >::curr [private] |
Pointer to the current list element.
Definition at line 158 of file IntrusiveDList.h.
Referenced by IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::IntrusiveTwoDListIter(), IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator *(), IntrusiveTwoDListIter< ElementT, ReturnT >::operator ReturnT *(), IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator++(), IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator->(), and IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator==().
ElementT* IntrusiveTwoDListIter< ElementT, ReturnT >::next [private] |
Pointer to the start of the second list.
Definition at line 163 of file IntrusiveDList.h.
Referenced by IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::IntrusiveTwoDListIter(), and IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator++().
bool IntrusiveTwoDListIter< ElementT, ReturnT >::processingNext [private] |
True if the first list has been walked.
Definition at line 168 of file IntrusiveDList.h.
Referenced by IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::IntrusiveTwoDListIter(), and IntrusiveTwoDListIter< TwoQDirtyPage, PageT >::operator++().