MIncrementalCollector Class Reference

class MIncrementalCollector

Interface for incrementally reclaiming or compacting space in a stream store. The interface allows these actions to be performed in small steps, so that applications can remain responsive while doing these potentially long-running tasks.

An instance of a class derived from this interface is returned by StreamStore::DoReclaimL() and DoCompactL(). Each step is carried out in response to a call of DoNextL() and the object is released on completion of the last step.

Notes:

One-step reclaim using CStreamStore::ReclaimL() is actually implemented in terms of the incremental collector.

A CStreamStore implementation will only need to implement a collector class if it supports reclamation or compaction.

Public Member Functions
voidClose()
voidNextL(TInt &, TInt &)
voidNextL(TPckgBuf< TInt > &, TRequestStatus &, TPckgBuf< TInt > &)
voidRelease()
voidResetL(TInt &)
Protected Member Functions
MIncrementalCollector()
Private Member Functions
MIncrementalCollector(const MIncrementalCollector &)
voidDoNextL(TInt &, TInt &)
IMPORT_C voidDoNextL(TPckgBuf< TInt > &, TRequestStatus &, TPckgBuf< TInt > &)
IMPORT_C voidDoRelease()
voidDoResetL(TInt &)
MIncrementalCollector &operator=(const MIncrementalCollector &)

Constructor & Destructor Documentation

MIncrementalCollector()

MIncrementalCollector()[protected, inline]

Protected constructor. Protecting the constructor ensures that this abstract class cannot be instantiated.

MIncrementalCollector(const MIncrementalCollector&);

MIncrementalCollector& operator=(const MIncrementalCollector&);

Private copy constructor and copy assignment to prevent

MIncrementalCollector(const MIncrementalCollector &)

MIncrementalCollector(const MIncrementalCollector &)[private]

Protected constructor. Protecting the constructor ensures that this abstract class cannot be instantiated.

MIncrementalCollector(const MIncrementalCollector&);

MIncrementalCollector& operator=(const MIncrementalCollector&);

Private copy constructor and copy assignment to prevent

Parameters

const MIncrementalCollector &

Member Functions Documentation

Close()

voidClose()[inline]

Closes the collector after it is no longer required. The object should not be referenced after calling this function. The semantics for this function and Release() are effectively the same.

DoNextL(TInt &, TInt &)

voidDoNextL(TInt &aStep,
TInt &aTotal
)[private, pure virtual]

Implementation of the public synchronous NextL() function. The next step in the reclamation should be done, reporting progress in aStep and aTotal.

Parameters

TInt & aStepThe progress value from either the last NextL() increment of from ResetL() if the reclamation/compaction was restarted. On return, should contain the new progress value, which can be used in subsequent calls to NextL(). This must be equal to, or less than, the previous value a zero value must be used to indicate that the operation is complete.
TInt & aTotalOn return, should contain the total amount of free space in the store.

DoNextL(TPckgBuf< TInt > &, TRequestStatus &, TPckgBuf< TInt > &)

IMPORT_C voidDoNextL(TPckgBuf< TInt > &aStep,
TRequestStatus &aStatus,
TPckgBuf< TInt > &aTotal
)[private, virtual]

Parameters

TPckgBuf< TInt > & aStep
TRequestStatus & aStatus
TPckgBuf< TInt > & aTotal

DoRelease()

IMPORT_C voidDoRelease()[private, virtual]

DoResetL(TInt &)

voidDoResetL(TInt &aCount)[private, pure virtual]

Implementation of the public ResetL() function. This signals that the client wants to start or retsart the operation from the beginning. A new progress count should be returned in aCount.

Parameters

TInt & aCountOn return, contains a progress count for the reclamation/compaction process.

NextL(TInt &, TInt &)

voidNextL(TInt &aStep,
TInt &aTotal
)[inline]

Does the next step in the reclaim synchronously.

aStep contains a progress value, which decreases every time the function is called. aTotal contains the running total of free-space that remains in the store.

DoNextL()

Parameters

TInt & aStepThe progress value from either the last NextL() increment of from ResetL() if the reclamation/compaction was restarted. On return, contains the new progress value, which can be used in subsequent calls to NextL(). This will be equal to, or less than, the previous value a zero value indicates that the operation is complete.
TInt & aTotalOn return, contains the total amount of free space in the store. This should increase every time the function is called.

NextL(TPckgBuf< TInt > &, TRequestStatus &, TPckgBuf< TInt > &)

voidNextL(TPckgBuf< TInt > &aStep,
TRequestStatus &aStatus,
TPckgBuf< TInt > &aTotal
)[inline]

Does the next step in the reclaim asynchronously.

aStep contains a progress value, which decreases every time the function is called. aTotal contains the running total of free-space that remains in the store. These parameters are asynchronous equivalents of the other NextL() overload.

DoNextL()

Parameters

TPckgBuf< TInt > & aStepThe progress value from either the last NextL() increment of from ResetL() if the reclamation/compaction was restarted. On return, contains the new progress value, which can be used in subsequent calls to NextL(). This will be equal to, or less than, the previous value a zero value indicates that the operation is complete.
TRequestStatus & aStatusA status variable. KErrNone on successful completion, otherwise another of the system-wide error codes.
TPckgBuf< TInt > & aTotalOn return, contains the total amount of free space in the store. This should increase every time the function is called.

Release()

voidRelease()[inline]

Releases the collector after it is no longer required. The object should not be referenced after calling this function. The semantics for this function and Close() are effectively the same.

DoRelease()

ResetL(TInt &)

voidResetL(TInt &aCount)[inline]

Resets the collector. This leaves the collector in a state ready to start or restart reclaiming/compacting. On return aCount contains a value that can be used to determine the progress of the operation the same value should be passed in to subsequent calls to NextL() until it reaches 0.

DoResetL()

Parameters

TInt & aCountA progress count for the reclamation/compaction process.

operator=(const MIncrementalCollector &)

MIncrementalCollector &operator=(const MIncrementalCollector &)[private]

Parameters

const MIncrementalCollector &