Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: S32STOR.H
Link against: estor.lib

Class RStorePagePool

class RStorePagePool : public TCachePagePool;

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.

Derivation

Members

Defined in RStorePagePool:
Close(), Create(), Discard(), DoDeleteL(), ExtendL(), HasAvailable(), IsDirty(), IsEmpty(), MarkCurrent(), MarkDirty(), Open(), RStorePagePool(), RStorePagePool(), RStorePagePool(), RStorePagePool(), ReadL(), ReclaimAllL(), ReclaimL(), Release(), Token(), WriteL()

Inherited from MPagePool:
Delete(), DeleteL(), Pop(), PushL()

Inherited from TCachePagePool:
AcquireL(), AllocL(), AssignL(), Flush(), FlushL(), LockL(), Purge(), Set(), Unlock(), UpdateL()

See also:


Construction and destruction


RStorePagePool()

IMPORT_C RStorePagePool();

Description

Default constructor.


RStorePagePool()

IMPORT_C RStorePagePool(CPageCache &aCache);

Description

Constructor with a page cache for the pool.

Parameters

CPageCache &aCache

Page cache for the pool


RStorePagePool()

IMPORT_C RStorePagePool(CStreamStore &aStore);

Description

Constructor with a stream store to use for the pool.

Parameters

CStreamStore &aStore

Stream store to use for the pool


RStorePagePool()

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

Description

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

Parameters

CStreamStore &aStore

Stream store to use for the pool

const TStorePagePoolToken &aToken

Stream store pool settings

[Top]


Member functions


Create()

IMPORT_C void Create(CStreamStore &aStore);

Description

Creates a new pool.

Parameters

CStreamStore &aStore

Stream store to use for the pool


Open()

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

Description

Opens an existing pool.

Parameters

CStreamStore &aStore

Stream store for the pool

const TStorePagePoolToken &aToken

Pool settings


Token()

IMPORT_C TStorePagePoolToken Token() const;

Description

Gets an object that encapsulates the page pool settings.

That object can then be used to externalise the settings.

Return value

TStorePagePoolToken

Encapsulates the page pool settings


Close()

IMPORT_C void Close();

Description

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


Release()

inline void Release();

Description

Purges the page cache and stops using the stream store.


IsDirty()

inline TBool IsDirty() const;

Description

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

Return value

TBool

True if the dirty flag has been set, otherwise false


MarkCurrent()

inline void MarkCurrent();

Description

Clears the dirty flag.


MarkDirty()

inline void MarkDirty();

Description

Sets the dirty flag on the pool.


HasAvailable()

inline TBool HasAvailable() const;

Description

Tests if there is a free page in the pool.

Return value

TBool

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


Discard()

inline void Discard();

Description

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.


IsEmpty()

inline TBool IsEmpty() const;

Description

Tests if the page pool is empty.

Return value

TBool

True if the page pool is empty, otherwise false


ReclaimL()

IMPORT_C TBool ReclaimL();

Description

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

Return value

TBool

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


ReclaimAllL()

IMPORT_C void ReclaimAllL();

Description

Deletes all streams in the store.


ExtendL()

protected: virtual IMPORT_C TPageRef ExtendL(const TAny *aPage, TPageReclamation aReclamation);

Description

Parameters

const TAny *aPage

TPageReclamation aReclamation

Return value

TPageRef


WriteL()

protected: virtual IMPORT_C void WriteL(TPageRef aRef, const TAny *aPage, TPageChange aChange);

Description

Parameters

TPageRef aRef

const TAny *aPage

TPageChange aChange


ReadL()

protected: virtual IMPORT_C void ReadL(TPageRef aRef, TAny *aPage);

Description

Parameters

TPageRef aRef

TAny *aPage


DoDeleteL()

protected: virtual IMPORT_C void DoDeleteL(TPageRef aRef);

Description

Parameters

TPageRef aRef