RFilePagePool Class Reference

#include <s32file.h>

class RFilePagePool : public TCachePagePool

Inherits from

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

See also: CPageCache RFile

Constructor & Destructor Documentation

RFilePagePool ( )

IMPORT_CRFilePagePool()

Default constructor.

RFilePagePool ( CPageCache & )

IMPORT_CRFilePagePool(CPageCache &aCache)

Constructor with a page cache for the pool.

ParameterDescription
aCachePage cache for the pool

Member Function Documentation

Attach ( RFile & )

voidAttach(RFile &aFile)[inline]

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

ParameterDescription
aFileFile to use for the page pool

Close ( )

IMPORT_C voidClose()

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

Create ( RFs &, const TDesC &, TUint )

TInt Create(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[inline]

Creates a new file for the page pool.

See also: TFileMode

ParameterDescription
aFsA file server session
aNameThe name of the file. Any path components which are not specified here are taken from the session path.
aFileModeThe mode in which the file is opened. For more information see the TFileMode enumeration.

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

Detach ( )

voidDetach()[inline]

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

ExtendL ( const TAny *, TPageReclamation )

IMPORT_C TPageRefExtendL(const TAny *aPage,
TPageReclamationaReclamation
)[protected, virtual]

Reimplemented from TCachePagePool::ExtendL(const TAny *,TPageReclamation)

File ( )

RFile &File()const [inline]

Flush ( )

IMPORT_C TIntFlush()

Reimplemented from TCachePagePool::Flush()

Flushes the page cache and the file.

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

FlushL ( )

IMPORT_C voidFlushL()

Reimplemented from TCachePagePool::FlushL()

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

Open ( RFs &, const TDesC &, TUint )

TInt Open(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[inline]

Opens a file to use for the page pool.

See also: TFileMode

ParameterDescription
aFsA file server session
aNameThe name of the file
aFileModeThe mode in which the file is opened. For more information, see the TFileMode enumeration.

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

ReadL ( TPageRef, TAny * )

IMPORT_C voidReadL(TPageRefaRef,
TAny *aPage
)[protected, virtual]

Release ( )

IMPORT_C voidRelease()

Closes the file without flushing the cache.

Replace ( RFs &, const TDesC &, TUint )

TInt Replace(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)[inline]

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.

See also: TFileMode

ParameterDescription
aFsA file server session.
aNameThe name of the file. Any path components which are not specified here are taken from the session path.
aFileModeThe mode in which the file is opened. For more information see the TFileMode enumeration.

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

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

TInt Temp(RFs &aFs,
const TDesC &aPath,
TFileName &aName,
TUintaFileMode
)[inline]

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

ParameterDescription
aFsA file server session.
aPathThe directory in which the file should be created.
aNameOn return, contains the full path and name of the file. The filename is guaranteed to be unique within the directory specified by aPath.
aFileModeThe mode in which the file is opened. For more information see the TFileMode enumeration.

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

WriteL ( TPageRef, const TAny *, TPageChange )

IMPORT_C voidWriteL(TPageRefaRef,
const TAny *aPage,
TPageChangeaChange
)[protected, virtual]