Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: S32FILE.H
Link against: estor.lib

Class RFilePagePool

class RFilePagePool : public TCachePagePool;

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

Members

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

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

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

See also:


Construction and destruction


RFilePagePool()

IMPORT_C RFilePagePool();

Description

Default constructor.


RFilePagePool()

IMPORT_C RFilePagePool(CPageCache &aCache);

Description

Constructor with a page cache for the pool.

Parameters

CPageCache &aCache

Page cache for the pool

[Top]


Member functions


Open()

inline 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:


Create()

inline 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:


Replace()

inline 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()

inline 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.


Attach()

inline 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


Close()

IMPORT_C void Close();

Description

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


Release()

IMPORT_C void Release();

Description

Closes the file without flushing the cache.


Flush()

IMPORT_C 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()

IMPORT_C void FlushL();

Description

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


Detach()

inline void Detach();

Description

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


File()

inline RFile &File() const;

Description

Return value

RFile &


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