TwoQDirtyPage Class Reference

TwoQDirtyPage is the attribute class that contains information about dirty pages. More...

#include <TwoQVictimPolicy.h>

Inheritance diagram for TwoQDirtyPage:

IntrusiveDListNode List of all members.

Public Types

enum  DirtyPageState { PAGE_CLEAN, PAGE_DIRTY_POPULAR_UNPINNED, PAGE_DIRTY_FRESHMAN, PAGE_DIRTY_POPULAR_PINNED }
 Enumeration indicating whether a page is dirty and if so, which queue the dirty page is in. More...

Public Member Functions

void setParentPage (CachePage &parentPageInit)
 Sets the parent page corresponding to the dirty object.
CachePagegetParentPage ()
 
Returns:
the parent page corresponding to the dirty object

DirtyPageState getDirtyState ()
 
Returns:
dirty state of a page

void setDirtyState (DirtyPageState newState)
 Sets a page's dirty state.
IntrusiveDListNodegetNext () const
IntrusiveDListNodegetPrev () const
void detach ()
void insertBefore (IntrusiveDListNode &newNext)
void insertAfter (IntrusiveDListNode &newPrev)

Private Attributes

CachePagepParentPage
 Pointer to the parent page corresponding to this dirty object.
DirtyPageState dirtyState
 The state of the dirty page.

Detailed Description

TwoQDirtyPage is the attribute class that contains information about dirty pages.

Objects representing dirty pages are linked together in doubly-linked lists with back pointers to the dirty parent pages. The lists are subsets of the full 2Q page queues, as they consist of only the dirty pages.

Definition at line 203 of file TwoQVictimPolicy.h.


Member Enumeration Documentation

enum TwoQDirtyPage::DirtyPageState

Enumeration indicating whether a page is dirty and if so, which queue the dirty page is in.

Enumerator:
PAGE_CLEAN  Page is not dirty.
PAGE_DIRTY_POPULAR_UNPINNED  Page is dirty and in the popular-unpinned queue.
PAGE_DIRTY_FRESHMAN  Page is dirty and in the freshmen queue.
PAGE_DIRTY_POPULAR_PINNED  Page is dirty and currently in the popular-pinned queue.

Definition at line 211 of file TwoQVictimPolicy.h.

00211                         {
00215         PAGE_CLEAN,
00216 
00220         PAGE_DIRTY_POPULAR_UNPINNED,
00221 
00225         PAGE_DIRTY_FRESHMAN,
00226 
00230         PAGE_DIRTY_POPULAR_PINNED
00231     };


Member Function Documentation

void TwoQDirtyPage::setParentPage ( CachePage parentPageInit  )  [inline]

Sets the parent page corresponding to the dirty object.

Parameters:
parentPageInit the parent page

Definition at line 250 of file TwoQVictimPolicy.h.

00251     {
00252         pParentPage = &parentPageInit;
00253     }

CachePage& TwoQDirtyPage::getParentPage (  )  [inline]

Returns:
the parent page corresponding to the dirty object

Definition at line 258 of file TwoQVictimPolicy.h.

Referenced by TwoQDirtyPageListIter< PageT >::getReturnElement().

00259     {
00260         return *pParentPage;
00261     }

DirtyPageState TwoQDirtyPage::getDirtyState (  )  [inline]

Returns:
dirty state of a page

Definition at line 266 of file TwoQVictimPolicy.h.

Referenced by TwoQVictimPolicy< PageT >::notifyPageClean(), TwoQVictimPolicy< PageT >::notifyPageDirty(), TwoQVictimPolicy< PageT >::notifyPageNice(), TwoQVictimPolicy< PageT >::notifyPageUnmap(), TwoQVictimPolicy< PageT >::notifyPageUnpin(), and TwoQVictimPolicy< PageT >::notifyPopularPageAccess().

00267     {
00268         return dirtyState;
00269     }

void TwoQDirtyPage::setDirtyState ( DirtyPageState  newState  )  [inline]

Sets a page's dirty state.

Parameters:
newState the new dirty state value for a page

Definition at line 276 of file TwoQVictimPolicy.h.

Referenced by TwoQVictimPolicy< PageT >::notifyPageClean(), TwoQVictimPolicy< PageT >::notifyPageDirty(), TwoQVictimPolicy< PageT >::notifyPageUnmap(), TwoQVictimPolicy< PageT >::notifyPageUnpin(), and TwoQVictimPolicy< PageT >::notifyPopularPageAccess().

00277     {
00278         dirtyState = newState;
00279     }

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

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, inherited]

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, inherited]

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, inherited]

Definition at line 66 of file IntrusiveDList.h.

References IntrusiveDListNode::pNext, and IntrusiveDListNode::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, inherited]

Definition at line 76 of file IntrusiveDList.h.

References IntrusiveDListNode::pNext, and IntrusiveDListNode::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

CachePage* TwoQDirtyPage::pParentPage [private]

Pointer to the parent page corresponding to this dirty object.

Definition at line 237 of file TwoQVictimPolicy.h.

DirtyPageState TwoQDirtyPage::dirtyState [private]

The state of the dirty page.

Definition at line 242 of file TwoQVictimPolicy.h.


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