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_C RStorePagePool ( )

RStorePagePool(CPageCache &)

IMPORT_C RStorePagePool ( CPageCache & aCache )

Parameters

CPageCache & aCache

RStorePagePool(CStreamStore &)

IMPORT_C RStorePagePool ( CStreamStore & aStore )

Parameters

CStreamStore & aStore

RStorePagePool(CStreamStore &, const TStorePagePoolToken &)

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

Parameters

CStreamStore & aStore
const TStorePagePoolToken & aToken

Member Functions Documentation

CacheDeleteL(TPageRef)

void CacheDeleteL ( TPageRef aRef ) [private, inline]

Parameters

TPageRef aRef

Close()

IMPORT_C void Close ( )

Create(CStreamStore &)

IMPORT_C void Create ( CStreamStore & aStore )

Parameters

CStreamStore & aStore

Discard()

void Discard ( ) [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 void DoDeleteL ( TPageRef aRef ) [protected, virtual]

Parameters

TPageRef aRef

ExtendL(const TAny *, TPageReclamation)

IMPORT_C TPageRef ExtendL ( const TAny * aPage,
TPageReclamation aReclamation
) [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()

void MarkCurrent ( ) [inline]

Clears the dirty flag.

MarkDirty()

void MarkDirty ( ) [inline]

Sets the dirty flag on the pool.

Open(CStreamStore &, const TStorePagePoolToken &)

IMPORT_C void Open ( CStreamStore & aStore,
const TStorePagePoolToken & aToken
)

Parameters

CStreamStore & aStore
const TStorePagePoolToken & aToken

ReadL(TPageRef, TAny *)

IMPORT_C void ReadL ( TPageRef aRef,
TAny * aPage
) [protected, virtual]

Parameters

TPageRef aRef
TAny * aPage

ReclaimAllL()

IMPORT_C void ReclaimAllL ( )

ReclaimL()

IMPORT_C TBool ReclaimL ( )

Release()

void Release ( ) [inline]

Purges the page cache and stops using the stream store.

Token()

IMPORT_C TStorePagePoolToken Token ( ) const

WriteL(TPageRef, const TAny *, TPageChange)

IMPORT_C void WriteL ( TPageRef aRef,
const TAny * aPage,
TPageChange aChange
) [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]