Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: sb32file.h
Link against: estor.lib

Class RFilePagePool

RFilePagePool

Description

Uses a file directly to implement the page pool interface MPagePool.

The pages are written sequentially through the file. You should call Close() to release the file resource after CreateL(), OpenL(), ReplaceL() or Temp().

A file 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

MPagePoolInterface to a page pool, the storage abstraction used by the B-trees API
RFilePagePoolUses a file directly to implement the page pool interface MPagePool
TCachePagePoolProvides a page pool with cached pages

Defined in RFilePagePool:
Attach(), Close(), Create(), Detach(), Flush(), FlushL(), Open(), RFilePagePool(), Release(), Replace(), Temp()

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

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

See also:


Construction


RFilePagePool()

RFilePagePool();

Description

Default constructor.


RFilePagePool()

RFilePagePool(CPageCache& aCache);

Description

Constructor with a page cache for the pool.

Parameters

CPageCache& aCache

Page cache for the pool

[Top]


Initialisation


Attach()

void Attach(RFile& aFile);

Description

Sets an existing file to be used for the page pool.

Parameters

RFile& aFile

File to use for the page pool


Create()

TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);

Description

Creates a new file for the page pool.

Parameters

RFs& aFs

A file server session

const TDesC& aName

The name of the file. Any path components which are not specified here are taken from the session path.

TUint aFileMode

The mode in which the file is opened. For more information see the TFileMode enumeration.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

See also:


Open()

TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);

Description

Opens a file to use for the page pool.

Parameters

RFs& aFs

A file server session

const TDesC& aName

The name of the file

TUint aFileMode

The mode in which the file is opened. For more information, see the TFileMode enumeration.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

See also:


Replace()

TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);

Description

Creates or opens a file for the page pool.

If there is an existing file with the same name, this function overwrites it. If the file does not already exist, it is created.

Parameters

RFs& aFs

A file server session.

const TDesC& aName

The name of the file. Any path components which are not specified here are taken from the session path.

TUint aFileMode

The mode in which the file is opened. For more information see the TFileMode enumeration.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

See also:


Temp()

TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);

Description

Creates and opens a file for the page pool with a unique name.

Parameters

RFs& aFs

A file server session.

const TDesC& aPath

The directory in which the file should be created.

TFileName& aName

On return, contains the full path and name of the file. The filename is guaranteed to be unique within the directory specified by aPath.

TUint aFileMode

The mode in which the file is opened. For more information see the TFileMode enumeration.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Resource release and closure


Close()

void Close();

Description

Flushes cached pages to the file, and closes the file.


Detach()

void Detach();

Description

Ends the use of the file for the page pool, but does not close the file.


Flush()

TInt Flush();

Description

Flushes the page cache and the file.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


FlushL()

void FlushL();

Description

Flushes the page cache and the file, leaving with a system-wide error code if an error occurs.


Release()

void Release();

Description

Closes the file without flushing the cache.