TwoQVictim Class Reference

TwoQVictim is the attributes class which must be a base for any CachePage type which will be cached using a TwoQVictimPolicy. More...

#include <TwoQVictimPolicy.h>

Inheritance diagram for TwoQVictim:

IntrusiveDListNode TwoQPage List of all members.

Public Types

enum  PageState { PAGE_STATE_POPULAR_PINNED, PAGE_STATE_POPULAR_UNPINNED, PAGE_STATE_FRESHMAN, PAGE_STATE_FREE }
 Enumeration of possible state values for a page when used with TwoQVictimPolicy. More...

Public Member Functions

 TwoQVictim ()
PageState getState ()
 
Returns:
state of a page

void setState (PageState newState)
 Sets a page's state.
TwoQDirtyPagegetDirtyPageNode ()
 
Returns:
the dirty node corresponding to the page

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

Private Attributes

PageState state
 State of the page.
TwoQDirtyPage dirtyPageNode
 Contains information about dirty pages.

Detailed Description

TwoQVictim is the attributes class which must be a base for any CachePage type which will be cached using a TwoQVictimPolicy.

Definition at line 286 of file TwoQVictimPolicy.h.


Member Enumeration Documentation

enum TwoQVictim::PageState

Enumeration of possible state values for a page when used with TwoQVictimPolicy.

Enumerator:
PAGE_STATE_POPULAR_PINNED  Page is in the popular-pinned queue.
PAGE_STATE_POPULAR_UNPINNED  Page is in the popular-unpinned queue.
PAGE_STATE_FRESHMAN  Page is in the freshmen queue.
PAGE_STATE_FREE  Page is not currently in the cache.

Definition at line 294 of file TwoQVictimPolicy.h.


Constructor & Destructor Documentation

TwoQVictim::TwoQVictim (  )  [inline]

Definition at line 326 of file TwoQVictimPolicy.h.

References TwoQDirtyPage::PAGE_CLEAN.


Member Function Documentation

PageState TwoQVictim::getState (  )  [inline]

Returns:
state of a page

Definition at line 335 of file TwoQVictimPolicy.h.

00336     {
00337         return state;
00338     }

void TwoQVictim::setState ( PageState  newState  )  [inline]

Sets a page's state.

Parameters:
newState the new state value for a page

Definition at line 345 of file TwoQVictimPolicy.h.

00346     {
00347         state = newState;
00348     }

TwoQDirtyPage& TwoQVictim::getDirtyPageNode (  )  [inline]

Returns:
the dirty node corresponding to the page

Definition at line 353 of file TwoQVictimPolicy.h.

00354     {
00355         return dirtyPageNode;
00356     }

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

PageState TwoQVictim::state [private]

State of the page.

Definition at line 317 of file TwoQVictimPolicy.h.

TwoQDirtyPage TwoQVictim::dirtyPageNode [private]

Contains information about dirty pages.

Definition at line 322 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