#include <RawIntrusiveList.h>
Inheritance diagram for RawIntrusiveList:
Public Member Functions | |
uint | size () const |
| |
bool | empty () const |
| |
void | clear (bool debugClear=true) |
Truncates this list to zero nodes. | |
Protected Member Functions | |
RawIntrusiveList () | |
IntrusiveListNode & | front () const |
IntrusiveListNode & | back () const |
void | push_front (IntrusiveListNode &t) |
void | push_back (IntrusiveListNode &t) |
bool | remove (IntrusiveListNode &) |
Protected Attributes | |
uint | nNodes |
Number of nodes in this list. | |
IntrusiveListNode * | pFront |
First node in this list. | |
IntrusiveListNode * | pBack |
Last node in this list. | |
Friends | |
class | RawIntrusiveListIter |
class | RawIntrusiveListMutator |
See InstrusiveList for details.
Definition at line 37 of file RawIntrusiveList.h.
RawIntrusiveList::RawIntrusiveList | ( | ) | [inline, explicit, protected] |
IntrusiveListNode& RawIntrusiveList::front | ( | ) | const [inline, protected] |
Reimplemented in IntrusiveList< T, DerivedListNode >.
Definition at line 65 of file RawIntrusiveList.h.
Referenced by IntrusiveList< T, DerivedListNode >::front().
00066 { 00067 return *pFront; 00068 }
IntrusiveListNode& RawIntrusiveList::back | ( | ) | const [inline, protected] |
Reimplemented in IntrusiveList< T, DerivedListNode >.
Definition at line 70 of file RawIntrusiveList.h.
Referenced by IntrusiveList< T, DerivedListNode >::back().
00071 { 00072 return *pBack; 00073 }
void RawIntrusiveList::push_front | ( | IntrusiveListNode & | t | ) | [protected] |
Definition at line 29 of file RawIntrusiveList.cpp.
References nNodes, pBack, pFront, and IntrusiveListNode::pNext.
Referenced by IntrusiveList< T, DerivedListNode >::push_front().
00030 { 00031 assert(!listNode.pNext); 00032 listNode.pNext = pFront; 00033 pFront = &listNode; 00034 if (!pBack) { 00035 pBack = pFront; 00036 } 00037 nNodes++; 00038 }
void RawIntrusiveList::push_back | ( | IntrusiveListNode & | t | ) | [protected] |
Definition at line 40 of file RawIntrusiveList.cpp.
References nNodes, pBack, pFront, and IntrusiveListNode::pNext.
Referenced by IntrusiveList< T, DerivedListNode >::push_back().
00041 { 00042 assert(!listNode.pNext); 00043 listNode.pNext = NULL; 00044 if (pBack) { 00045 pBack = pBack->pNext = &listNode; 00046 } else { 00047 pFront = pBack = &listNode; 00048 } 00049 nNodes++; 00050 }
bool RawIntrusiveList::remove | ( | IntrusiveListNode & | ) | [protected] |
Definition at line 68 of file RawIntrusiveList.cpp.
Referenced by IntrusiveList< T, DerivedListNode >::remove().
00069 { 00070 for (RawIntrusiveListMutator iter(*this); iter.getCurrent(); ++iter) { 00071 if (iter.getCurrent() == &listNode) { 00072 iter.detach(); 00073 return 1; 00074 } 00075 } 00076 return 0; 00077 }
uint RawIntrusiveList::size | ( | ) | const [inline] |
Definition at line 85 of file RawIntrusiveList.h.
Referenced by AioLinuxScheduler::submitRequests().
00086 { 00087 return nNodes; 00088 }
bool RawIntrusiveList::empty | ( | ) | const [inline] |
Definition at line 93 of file RawIntrusiveList.h.
00094 { 00095 return nNodes ? false : true; 00096 }
void RawIntrusiveList::clear | ( | bool | debugClear = true |
) |
Truncates this list to zero nodes.
debugClear | when true and a DEBUG build is in effect, pNext links of nodes are nulled out |
Definition at line 52 of file RawIntrusiveList.cpp.
References nNodes, pBack, pFront, and IntrusiveListNode::pNext.
00053 { 00054 nNodes = 0; 00055 #ifdef DEBUG 00056 if (debugClear) { 00057 IntrusiveListNode *p = pFront; 00058 while (p) { 00059 IntrusiveListNode *pNext = p->pNext; 00060 p->pNext = NULL; 00061 p = pNext; 00062 } 00063 } 00064 #endif 00065 pFront = pBack = NULL; 00066 }
friend class RawIntrusiveListIter [friend] |
Definition at line 39 of file RawIntrusiveList.h.
friend class RawIntrusiveListMutator [friend] |
Definition at line 40 of file RawIntrusiveList.h.
uint RawIntrusiveList::nNodes [protected] |
Number of nodes in this list.
Definition at line 46 of file RawIntrusiveList.h.
Referenced by clear(), RawIntrusiveListMutator::detach(), push_back(), and push_front().
IntrusiveListNode* RawIntrusiveList::pFront [protected] |
First node in this list.
Definition at line 51 of file RawIntrusiveList.h.
Referenced by clear(), RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::demoteFrontBeforeCurr(), RawIntrusiveListMutator::detach(), RawIntrusiveListMutator::promoteCurrToFront(), push_back(), push_front(), RawIntrusiveListMutator::repositionToFront(), and RawIntrusiveListIter::repositionToFront().
IntrusiveListNode* RawIntrusiveList::pBack [protected] |
Last node in this list.
Definition at line 56 of file RawIntrusiveList.h.
Referenced by clear(), RawIntrusiveListMutator::demoteCurrToBack(), RawIntrusiveListMutator::detach(), RawIntrusiveListMutator::promoteCurrToFront(), push_back(), and push_front().