#include <IntrusiveList.h>
Inheritance diagram for IntrusiveListMutator< T, DerivedListNode >:
Public Member Functions | |
IntrusiveListMutator () | |
Constructs a singular mutator. | |
IntrusiveListMutator (IntrusiveList< T, DerivedListNode > &list) | |
Constructs a mutator positioned at the front of a given list. | |
T * | operator-> () const |
| |
operator T * () const | |
| |
T & | operator * () const |
| |
T * | detach () |
Removes current element from list. | |
void | repositionToFront (IntrusiveList< T, DerivedListNode > &list) |
Repositions this mutator to the front of a given list. | |
void | repositionToFront () |
Repositions this mutator to the front of the current list. | |
void | operator++ () |
Advances iterator position to next node. | |
void | promoteCurrToFront () |
Moves the current node to the front of the list. | |
void | demoteCurrToBack () |
Moves the current node to the back of the list. | |
void | demoteFrontBeforeCurr () |
Moves the front node of the list to just before the current node. | |
Protected Member Functions | |
IntrusiveListNode * | getCurrent () const |
void | repositionToFront (RawIntrusiveList &l) |
Protected Attributes | |
IntrusiveListNode * | pCurr |
IntrusiveListNode * | pPrev |
RawIntrusiveList * | pList |
bool | bJustDeleted |
Private Types | |
typedef RawIntrusiveListMutator | super |
It allows the list to be modified during the course of iteration.
Definition at line 181 of file IntrusiveList.h.
typedef RawIntrusiveListMutator IntrusiveListMutator< T, DerivedListNode >::super [private] |
Definition at line 184 of file IntrusiveList.h.
IntrusiveListMutator< T, DerivedListNode >::IntrusiveListMutator | ( | ) | [inline, explicit] |
IntrusiveListMutator< T, DerivedListNode >::IntrusiveListMutator | ( | IntrusiveList< T, DerivedListNode > & | list | ) | [inline, explicit] |
Constructs a mutator positioned at the front of a given list.
list | the list to access |
Definition at line 199 of file IntrusiveList.h.
00201 : super(list) 00202 { 00203 }
T* IntrusiveListMutator< T, DerivedListNode >::operator-> | ( | ) | const [inline] |
Definition at line 208 of file IntrusiveList.h.
References RawIntrusiveListMutator::getCurrent().
00209 { 00210 return static_cast<T *>( 00211 static_cast<DerivedListNode *>(getCurrent())); 00212 }
IntrusiveListMutator< T, DerivedListNode >::operator T * | ( | ) | const [inline] |
Definition at line 217 of file IntrusiveList.h.
References RawIntrusiveListMutator::getCurrent().
00218 { 00219 return static_cast<T *>( 00220 static_cast<DerivedListNode *>(getCurrent())); 00221 }
T& IntrusiveListMutator< T, DerivedListNode >::operator * | ( | ) | const [inline] |
Definition at line 226 of file IntrusiveList.h.
References RawIntrusiveListMutator::getCurrent().
00227 { 00228 return *static_cast<T *>( 00229 static_cast<DerivedListNode *>(getCurrent())); 00230 }
T* IntrusiveListMutator< T, DerivedListNode >::detach | ( | ) | [inline] |
Removes current element from list.
This mutator will advance to the original successor on next increment.
Reimplemented from RawIntrusiveListMutator.
Definition at line 238 of file IntrusiveList.h.
References RawIntrusiveListMutator::detach().
Referenced by CacheImpl< PageT, VictimPolicyT >::findFreePage(), ThreadPoolScheduler::schedule(), IoCompletionPortScheduler::schedule(), AioSignalScheduler::schedule(), AioPollingScheduler::schedule(), CacheImpl< PageT, VictimPolicyT >::setAllocatedPageCount(), and AioLinuxScheduler::submitRequests().
00239 { 00240 return static_cast<T *>( 00241 static_cast<DerivedListNode *>(super::detach())); 00242 }
void IntrusiveListMutator< T, DerivedListNode >::repositionToFront | ( | IntrusiveList< T, DerivedListNode > & | list | ) | [inline] |
Repositions this mutator to the front of a given list.
list | the list to access |
Definition at line 249 of file IntrusiveList.h.
References RawIntrusiveListMutator::repositionToFront().
00251 { 00252 super::repositionToFront(list); 00253 }
void IntrusiveListMutator< T, DerivedListNode >::repositionToFront | ( | ) | [inline] |
Repositions this mutator to the front of the current list.
Reimplemented from RawIntrusiveListMutator.
Definition at line 258 of file IntrusiveList.h.
References RawIntrusiveListMutator::repositionToFront().
00259 { 00260 super::repositionToFront(); 00261 }
IntrusiveListNode* RawIntrusiveListMutator::getCurrent | ( | ) | const [inline, protected, inherited] |
Definition at line 173 of file RawIntrusiveList.h.
Referenced by IntrusiveListMutator< T, DerivedListNode >::operator *(), IntrusiveListMutator< T, DerivedListNode >::operator T *(), and IntrusiveListMutator< T, DerivedListNode >::operator->().
00174 { 00175 return pCurr; 00176 }
void RawIntrusiveListMutator::repositionToFront | ( | RawIntrusiveList & | l | ) | [inline, protected, inherited] |
Definition at line 178 of file RawIntrusiveList.h.
References RawIntrusiveList::pFront.
00179 { 00180 pList = &l; 00181 bJustDeleted = 0; 00182 pCurr = pList->pFront; 00183 pPrev = NULL; 00184 }
void RawIntrusiveListMutator::operator++ | ( | ) | [inline, inherited] |
Advances iterator position to next node.
Definition at line 192 of file RawIntrusiveList.h.
00193 { 00194 if (bJustDeleted) { 00195 bJustDeleted = 0; 00196 } else { 00197 pPrev = pCurr; 00198 if (pCurr) { 00199 pCurr = pCurr->pNext; 00200 } 00201 } 00202 }
void RawIntrusiveListMutator::promoteCurrToFront | ( | ) | [inherited] |
Moves the current node to the front of the list.
This iterator will advance to the original successor on next increment.
Definition at line 79 of file RawIntrusiveList.cpp.
References RawIntrusiveListMutator::bJustDeleted, RawIntrusiveList::pBack, RawIntrusiveListMutator::pCurr, RawIntrusiveList::pFront, RawIntrusiveListMutator::pList, IntrusiveListNode::pNext, and RawIntrusiveListMutator::pPrev.
00080 { 00081 assert(pCurr); 00082 if (pList->pFront == pCurr) { 00083 return; 00084 } 00085 if (pList->pBack == pCurr) { 00086 pList->pBack = pPrev; 00087 } 00088 pPrev->pNext = pCurr->pNext; 00089 pCurr->pNext = pList->pFront; 00090 pList->pFront = pCurr; 00091 pCurr = pPrev->pNext; 00092 bJustDeleted = 1; 00093 }
void RawIntrusiveListMutator::demoteCurrToBack | ( | ) | [inherited] |
Moves the current node to the back of the list.
This iterator will advance to the original successor on next increment.
Definition at line 95 of file RawIntrusiveList.cpp.
References RawIntrusiveListMutator::bJustDeleted, RawIntrusiveList::pBack, RawIntrusiveListMutator::pCurr, RawIntrusiveList::pFront, RawIntrusiveListMutator::pList, IntrusiveListNode::pNext, and RawIntrusiveListMutator::pPrev.
00096 { 00097 assert(pCurr); 00098 if (pList->pBack == pCurr) { 00099 return; 00100 } 00101 if (pPrev) { 00102 pPrev->pNext = pCurr->pNext; 00103 } else { 00104 pList->pFront = pCurr->pNext; 00105 } 00106 pCurr->pNext = NULL; 00107 pList->pBack->pNext = pCurr; 00108 pList->pBack = pCurr; 00109 if (pPrev) { 00110 pCurr = pPrev->pNext; 00111 } else { 00112 pCurr = pList->pFront; 00113 } 00114 bJustDeleted = 1; 00115 }
void RawIntrusiveListMutator::demoteFrontBeforeCurr | ( | ) | [inherited] |
Moves the front node of the list to just before the current node.
Iterator position is unchanged.
Definition at line 117 of file RawIntrusiveList.cpp.
References RawIntrusiveListMutator::pCurr, RawIntrusiveList::pFront, RawIntrusiveListMutator::pList, IntrusiveListNode::pNext, and RawIntrusiveListMutator::pPrev.
00118 { 00119 assert(pCurr); 00120 if (!pPrev) { 00121 return; 00122 } 00123 IntrusiveListNode *pOldFront = pList->pFront; 00124 if (pOldFront == pPrev) { 00125 return; 00126 } 00127 pList->pFront = pOldFront->pNext; 00128 pPrev = pPrev->pNext = pOldFront; 00129 pOldFront->pNext = pCurr; 00130 }
IntrusiveListNode* RawIntrusiveListMutator::pCurr [protected, inherited] |
Definition at line 156 of file RawIntrusiveList.h.
Referenced by RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::demoteFrontBeforeCurr(), RawIntrusiveListMutator::detach(), and RawIntrusiveListMutator::promoteCurrToFront().
IntrusiveListNode * RawIntrusiveListMutator::pPrev [protected, inherited] |
Definition at line 156 of file RawIntrusiveList.h.
Referenced by RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::demoteFrontBeforeCurr(), RawIntrusiveListMutator::detach(), and RawIntrusiveListMutator::promoteCurrToFront().
RawIntrusiveList* RawIntrusiveListMutator::pList [protected, inherited] |
Definition at line 157 of file RawIntrusiveList.h.
Referenced by RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::demoteFrontBeforeCurr(), RawIntrusiveListMutator::detach(), and RawIntrusiveListMutator::promoteCurrToFront().
bool RawIntrusiveListMutator::bJustDeleted [protected, inherited] |
Definition at line 158 of file RawIntrusiveList.h.
Referenced by RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::detach(), and RawIntrusiveListMutator::promoteCurrToFront().