Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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 RFilePagePool::Close() to release the file resource after CreateL(), OpenL(), ReplaceL() or RFilePagePool::Temp(RFs &,const TDesC &,TFileName &,TUint).

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:

Inherited from MPagePool:

Inherited from TCachePagePool:


Construction and destruction


RFilePagePool()

IMPORT_C RFilePagePool();

Description

Default constructor.


RFilePagePool(CPageCache &)

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(RFs &,const TDesC &,TUint)

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 TDesC16 &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.


Create(RFs &,const TDesC &,TUint)

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 TDesC16 &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.


Replace(RFs &,const TDesC &,TUint)

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 TDesC16 &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.


Temp(RFs &,const TDesC &,TFileName &,TUint)

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 TDesC16 &aPath

The directory in which the file should be created.

TBuf &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(RFile &)

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

inline RFile& File() const;

Description

Return value

RFile &


ExtendL(const TAny *,TPageReclamation)

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

Description

Parameters

const TAny *aPage

TPageReclamation aReclamation

Return value

TPageRef


WriteL(TPageRef,const TAny *,TPageChange)

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

Description

Parameters

TPageRef aRef

const TAny *aPage

TPageChange aChange


ReadL(TPageRef,TAny *)

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

Description

Parameters

TPageRef aRef

TAny *aPage