|
||
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(TStreamId)
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.
MPagePool
-
Interface to a page pool, the storage abstraction used by the B-trees API.
TCachePagePool
-
Provides a page pool with cached pages.
RStorePagePool
-
Uses a store to implement the page pool interface MPagePool.
Defined in RStorePagePool
:
Close()
Flushes and purges the page cache and stops using the stream store. Create(CStreamStore &)
Creates a new pool.Discard()
Invalidates the list of free pages in the reclaimable set.DoDeleteL(TPageRef)
ExtendL(const TAny *,TPageReclamation)
HasAvailable()const
Tests if there is a free page in the pool.IsDirty()const
Tests if the dirty flag has been set on the page pool.IsEmpty()const
Tests if the page pool is empty.MarkCurrent()
Clears the dirty flag. MarkDirty()
Sets the dirty flag on the pool. Open(CStreamStore &,const TStorePagePoolToken &)
Opens an existing pool.RStorePagePool()
Default constructor. RStorePagePool(CPageCache &)
Constructor with a page cache for the pool.RStorePagePool(CStreamStore &)
Constructor with a stream store to use for the pool.RStorePagePool(CStreamStore &,const TStorePagePoolToken &)
Constructor with a stream store and settings to use for the pool.ReadL(TPageRef,TAny *)
ReclaimAllL()
Deletes all streams in the store. ReclaimL()
Deletes the first stream that stores reclaimable pages in the store.Release()
Purges the page cache and stops using the stream store. Token()const
Gets an object that encapsulates the page pool settings.WriteL(TPageRef,const TAny *,TPageChange)
Inherited from MPagePool
:
Delete(TPageRef)
Deletes a page, ignoring any errors.DeleteL(TPageRef)
Deletes a page, leaving if an error occurs.Pop()
Do a pop from the cleanup stack. PushL()
Pushes this object onto the cleanup stack. Inherited from TCachePagePool
:
AcquireL()
Returns a function that abandons all locked pages for this page pool.AllocL()
Allocates an unassigned page.AssignL(const TAny *,TPageReclamation)
Assigns a reference to a new page and unlocks it.Flush()
Flush all pages in this pool from the cache.FlushL()
Flushes all pages in this pool from the cache, leaving with a system-wide error ...LockL(TPageRef)
Locks a page and returns a pointer to it.Purge()
Purge all pages in this pool from the cache.Set(CPageCache &)
Sets the page cache for the pool.TCachePagePool(CPageCache &)
Unlock(const TAny *,TPageChange)
Unlocks a page.UpdateL(const TAny *)
Updates a page.CStreamStore
...IMPORT_C RStorePagePool(CPageCache &aCache);
Constructor with a page cache for the pool.
|
IMPORT_C RStorePagePool(CStreamStore &aStore);
Constructor with a 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.
|
IMPORT_C void Create(CStreamStore &aStore);
Creates a new pool.
|
IMPORT_C void Open(CStreamStore &aStore, const TStorePagePoolToken &aToken);
Opens an existing pool.
|
IMPORT_C TStorePagePoolToken Token() const;
Gets an object that encapsulates the page pool settings.
That object can then be used to externalise the settings.
|
IMPORT_C void Close();
Flushes and purges the page cache and stops using the stream store.
inline TBool IsDirty() const;
Tests if the dirty flag has been set on the page pool.
|
inline TBool HasAvailable() const;
Tests if there is a free page in the pool.
|
inline void Discard();
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 RStorePagePool::ReclaimAllL()
, and the BTree then repaired.
inline TBool IsEmpty() const;
Tests if the page pool is empty.
|
IMPORT_C TBool ReclaimL();
Deletes the first stream that stores reclaimable pages in the store.
|
protected: IMPORT_C virtual TPageRef ExtendL(const TAny *aPage, TPageReclamation aReclamation);
|
|
protected: IMPORT_C virtual void WriteL(TPageRef aRef, const TAny *aPage, TPageChange aChange);
|