RStorePagePool Class Reference

class RStorePagePool : public TCachePagePool

Uses a store to implement the page pool interface MPagePool.

Pages can be reclaimable (tracked by the page pool, so that they can be freed when required) or not (in which case they must be deleted explicitly): this is indicated by a flag of type TPageReclamation. Non-reclaimable pages each have their own stream in the store; reclaimable pages are bundled 15 to a stream. To track the reclaimable pages, the page pool has a separate token, type TStorePagePoolToken, that must be saved by the user of the pool.

The store used must support CStreamStore::ExtendL(), CStreamStore::DeleteL() and allow streams to be re-written. CPermanentFileStore meets these conditions.

A store page pool uses a cache to store pages in-memory and to cache frequently accessed pages. You should provide a cache object (CPageCache) to the pool for this purpose.

CPageCache CPermanentFileStore CStreamStore TPageReclamation

Inherits from

Constructor & Destructor Documentation

RStorePagePool()

IMPORT_CRStorePagePool()

RStorePagePool(CPageCache &)

IMPORT_CRStorePagePool(CPageCache &aCache)

Parameters

CPageCache & aCache

RStorePagePool(CStreamStore &)

IMPORT_CRStorePagePool(CStreamStore &aStore)

Parameters

CStreamStore & aStore

RStorePagePool(CStreamStore &, const TStorePagePoolToken &)

IMPORT_CRStorePagePool(CStreamStore &aStore,
const TStorePagePoolToken &aToken
)

Parameters

CStreamStore & aStore
const TStorePagePoolToken & aToken

Member Functions Documentation

CacheDeleteL(TPageRef)

voidCacheDeleteL(TPageRefaRef)[private, inline]

Parameters

TPageRef aRef

Close()

IMPORT_C voidClose()

Create(CStreamStore &)

IMPORT_C voidCreate(CStreamStore &aStore)

Parameters

CStreamStore & aStore

Discard()

voidDiscard()[inline]

Invalidates the list of free pages in the reclaimable set.

This should be done if there has been a failure in updating the BTree, as this list is possibly corrupt now. The reclaimable set can be deleted using ReclaimAllL(), and the BTree then repaired.

DoDeleteL(TPageRef)

IMPORT_C voidDoDeleteL(TPageRefaRef)[protected, virtual]

Parameters

TPageRef aRef

ExtendL(const TAny *, TPageReclamation)

IMPORT_C TPageRefExtendL(const TAny *aPage,
TPageReclamationaReclamation
)[protected, virtual]

Parameters

const TAny * aPage
TPageReclamation aReclamation

HasAvailable()

TBool HasAvailable()const [inline]

Tests if there is a free page in the pool.

IsDirty()

TBool IsDirty()const [inline]

Tests if the dirty flag has been set on the page pool.

IsEmpty()

TBool IsEmpty()const [inline]

Tests if the page pool is empty.

MarkCurrent()

voidMarkCurrent()[inline]

Clears the dirty flag.

MarkDirty()

voidMarkDirty()[inline]

Sets the dirty flag on the pool.

Open(CStreamStore &, const TStorePagePoolToken &)

IMPORT_C voidOpen(CStreamStore &aStore,
const TStorePagePoolToken &aToken
)

Parameters

CStreamStore & aStore
const TStorePagePoolToken & aToken

ReadL(TPageRef, TAny *)

IMPORT_C voidReadL(TPageRefaRef,
TAny *aPage
)[protected, virtual]

Parameters

TPageRef aRef
TAny * aPage

ReclaimAllL()

IMPORT_C voidReclaimAllL()

ReclaimL()

IMPORT_C TBoolReclaimL()

Release()

voidRelease()[inline]

Purges the page cache and stops using the stream store.

Token()

IMPORT_C TStorePagePoolTokenToken()const

WriteL(TPageRef, const TAny *, TPageChange)

IMPORT_C voidWriteL(TPageRefaRef,
const TAny *aPage,
TPageChangeaChange
)[protected, virtual]

Parameters

TPageRef aRef
const TAny * aPage
TPageChange aChange

Member Data Documentation

TPageRef iAvail

TPageRef iAvail[private]

TBool iDirty

TBool iDirty[private]

TStreamId iHead

TStreamId iHead[private]

CStreamStore * iStore

CStreamStore *iStore[private]