RStorePagePool Class Reference

#include <s32stor.h>

class RStorePagePool : public TCachePagePool

Inherits from

Detailed Description

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.

See also: CPageCache CPermanentFileStore CStreamStore TPageReclamation

Constructor & Destructor Documentation

RStorePagePool ( )

IMPORT_CRStorePagePool()

Default constructor.

RStorePagePool ( CPageCache & )

IMPORT_CRStorePagePool(CPageCache &aCache)

Constructor with a page cache for the pool.

ParameterDescription
aCachePage cache for the pool

RStorePagePool ( CStreamStore & )

IMPORT_CRStorePagePool(CStreamStore &aStore)

Constructor with a stream store to use for the pool.

ParameterDescription
aStoreStream store to use for the pool

RStorePagePool ( CStreamStore &, const TStorePagePoolToken & )

IMPORT_CRStorePagePool(CStreamStore &aStore,
const TStorePagePoolToken &aToken
)

Constructor with a stream store and settings to use for the pool.

ParameterDescription
aStoreStream store to use for the pool
aTokenStream store pool settings

Member Function Documentation

Close ( )

IMPORT_C voidClose()

Flushes and purges the page cache and stops using the stream store.

Create ( CStreamStore & )

IMPORT_C voidCreate(CStreamStore &aStore)

Creates a new pool.

ParameterDescription
aStoreStream store to use for the pool

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]

Reimplemented from TCachePagePool::DoDeleteL(TPageRef)

ExtendL ( const TAny *, TPageReclamation )

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

HasAvailable ( )

TBool HasAvailable()const [inline]

Tests if there is a free page in the pool.

Returns: True if there is a free page in the pool, otherwise false

IsDirty ( )

TBool IsDirty()const [inline]

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

Returns: True if the dirty flag has been set, otherwise false

IsEmpty ( )

TBool IsEmpty()const [inline]

Tests if the page pool is empty.

Returns: True if the page pool is empty, otherwise false

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
)

Opens an existing pool.

ParameterDescription
aStoreStream store for the pool
aTokenPool settings

ReadL ( TPageRef, TAny * )

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

ReclaimAllL ( )

IMPORT_C voidReclaimAllL()

Deletes all streams in the store.

ReclaimL ( )

IMPORT_C TBoolReclaimL()

Deletes the first stream that stores reclaimable pages in the store.

Returns: True if there are remaining streams (pages), false if there are no more streams

Release ( )

voidRelease()[inline]

Purges the page cache and stops using the stream store.

Token ( )

IMPORT_C TStorePagePoolTokenToken()const

Gets an object that encapsulates the page pool settings.

That object can then be used to externalise the settings.

Returns: Encapsulates the page pool settings

WriteL ( TPageRef, const TAny *, TPageChange )

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