IntrusiveDListNode Class Reference

A link in an intrusive doubly-linked list. More...

#include <IntrusiveDList.h>

Inheritance diagram for IntrusiveDListNode:

LRUVictim TwoQDirtyPage TwoQVictim LRUPage TwoQPage List of all members.

Public Member Functions

 IntrusiveDListNode ()
IntrusiveDListNodegetNext () const
IntrusiveDListNodegetPrev () const
void detach ()
void insertBefore (IntrusiveDListNode &newNext)
void insertAfter (IntrusiveDListNode &newPrev)

Private Attributes

IntrusiveDListNodepPrev
IntrusiveDListNodepNext

Detailed Description

A link in an intrusive doubly-linked list.

Definition at line 34 of file IntrusiveDList.h.


Constructor & Destructor Documentation

IntrusiveDListNode::IntrusiveDListNode (  )  [inline, explicit]

Definition at line 40 of file IntrusiveDList.h.

00041     {
00042         pPrev = pNext = NULL;
00043     }


Member Function Documentation

IntrusiveDListNode* IntrusiveDListNode::getNext (  )  const [inline]

Definition at line 45 of file IntrusiveDList.h.

Referenced by TwoQPageQueue::moveToTail(), TwoQPageQueue::remove(), and TwoQPageQueue::validateQueue().

00046     {
00047         return pNext;
00048     }

IntrusiveDListNode* IntrusiveDListNode::getPrev (  )  const [inline]

Definition at line 50 of file IntrusiveDList.h.

Referenced by TwoQPageQueue::moveToHead(), TwoQPageQueue::remove(), and TwoQPageQueue::validateQueue().

00051     {
00052         return pPrev;
00053     }

void IntrusiveDListNode::detach (  )  [inline]

Definition at line 55 of file IntrusiveDList.h.

Referenced by TwoQPageQueue::moveToHead(), TwoQPageQueue::moveToTail(), and TwoQPageQueue::remove().

00056     {
00057         if (pNext) {
00058             pNext->pPrev = pPrev;
00059         }
00060         if (pPrev) {
00061             pPrev->pNext = pNext;
00062         }
00063         pPrev = pNext = NULL;
00064     }

void IntrusiveDListNode::insertBefore ( IntrusiveDListNode newNext  )  [inline]

Definition at line 66 of file IntrusiveDList.h.

References pNext, and pPrev.

Referenced by TwoQPageQueue::insertAtHead(), and TwoQPageQueue::moveToHead().

00067     {
00068         pNext = &newNext;
00069         pPrev = pNext->pPrev;
00070         pNext->pPrev = this;
00071         if (pPrev) {
00072             pPrev->pNext = this;
00073         }
00074     }

void IntrusiveDListNode::insertAfter ( IntrusiveDListNode newPrev  )  [inline]

Definition at line 76 of file IntrusiveDList.h.

References pNext, and pPrev.

Referenced by TwoQPageQueue::insertAtTail(), and TwoQPageQueue::moveToTail().

00077     {
00078         pPrev = &newPrev;
00079         pNext = pPrev->pNext;
00080         pPrev->pNext = this;
00081         if (pNext) {
00082             pNext->pPrev = this;
00083         }
00084     }


Member Data Documentation

IntrusiveDListNode* IntrusiveDListNode::pPrev [private]

Definition at line 36 of file IntrusiveDList.h.

Referenced by insertAfter(), and insertBefore().

IntrusiveDListNode* IntrusiveDListNode::pNext [private]

Definition at line 37 of file IntrusiveDList.h.

Referenced by insertAfter(), and insertBefore().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 04:00:33 2009 for Fennel by  doxygen 1.5.1