#include <s32stor.h>
class RStorePagePool : public TCachePagePool |
Public Member Functions | |
---|---|
RStorePagePool() | |
RStorePagePool(CPageCache &) | |
RStorePagePool(CStreamStore &) | |
RStorePagePool(CStreamStore &, const TStorePagePoolToken &) | |
IMPORT_C void | Close() |
IMPORT_C void | Create(CStreamStore &) |
void | Discard() |
TBool | HasAvailable() |
TBool | IsDirty() |
TBool | IsEmpty() |
void | MarkCurrent() |
void | MarkDirty() |
IMPORT_C void | Open(CStreamStore &, const TStorePagePoolToken &) |
IMPORT_C void | ReclaimAllL() |
IMPORT_C TBool | ReclaimL() |
void | Release() |
IMPORT_C TStorePagePoolToken | Token() |
Protected Member Functions | |
---|---|
virtual IMPORT_C void | DoDeleteL(TPageRef) |
virtual IMPORT_C TPageRef | ExtendL(const TAny *, TPageReclamation) |
virtual IMPORT_C void | ReadL(TPageRef, TAny *) |
virtual IMPORT_C void | WriteL(TPageRef, const TAny *, TPageChange) |
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
IMPORT_C | RStorePagePool | ( | CPageCache & | aCache | ) |
Constructor with a page cache for the pool.
Parameter | Description |
---|---|
aCache | Page cache for the pool |
IMPORT_C | RStorePagePool | ( | CStreamStore & | aStore | ) |
Constructor with a stream store to use for the pool.
Parameter | Description |
---|---|
aStore | Stream store to use for the pool |
IMPORT_C | RStorePagePool | ( | CStreamStore & | aStore, |
const TStorePagePoolToken & | aToken | |||
) |
Constructor with a stream store and settings to use for the pool.
Parameter | Description |
---|---|
aStore | Stream store to use for the pool |
aToken | Stream store pool settings |
IMPORT_C void | Create | ( | CStreamStore & | aStore | ) |
Creates a new pool.
Parameter | Description |
---|---|
aStore | Stream store to use for the pool |
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.
IMPORT_C void | DoDeleteL | ( | TPageRef | aRef | ) | [protected, virtual] |
Reimplemented from TCachePagePool::DoDeleteL(TPageRef)
IMPORT_C TPageRef | ExtendL | ( | const TAny * | aPage, |
TPageReclamation | aReclamation | |||
) | [protected, virtual] |
Reimplemented from TCachePagePool::ExtendL(const TAny *,TPageReclamation)
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
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
TBool | IsEmpty | ( | ) | const [inline] |
Tests if the page pool is empty.
Returns: True if the page pool is empty, otherwise false
IMPORT_C void | Open | ( | CStreamStore & | aStore, |
const TStorePagePoolToken & | aToken | |||
) |
Opens an existing pool.
Parameter | Description |
---|---|
aStore | Stream store for the pool |
aToken | Pool settings |
IMPORT_C TBool | ReclaimL | ( | ) |
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
IMPORT_C TStorePagePoolToken | Token | ( | ) | 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
IMPORT_C void | WriteL | ( | TPageRef | aRef, |
const TAny * | aPage, | |||
TPageChange | aChange | |||
) | [protected, virtual] |
Reimplemented from TCachePagePool::WriteL(TPageRef,const TAny *,TPageChange)