|
||
class CStreamStore : public CBase;
Provides the core abstract framework for stores allowing streams to be created and manipulated.
CBase
-
Base class for all classes to be instantiated on the heap.
CStreamStore
- ...
Defined in CStreamStore
:
Commit()
Commits changes.CommitL()
Commit changes and leaves if unsuccessful.CompactL()
Compacts the store. This returns free space to the appropriate system pool, for ...Delete(TStreamId)
Deletes the specified stream from this store.DeleteL(TStreamId)
Deletes the specified stream from this store, leaving if unsuccessful.DoCommitL()
Commits any changes to the store. For a store that provides atomic updates, this...DoCompactL()
Initialises an object for compacting space in the store. This function provides ...DoCreateL(TStreamId &)
Creates a new stream in the store. The function gets the allocated stream id in ...DoDeleteL(TStreamId)
DoExtendL()
Generates a new stream within this store, and returns its id. This function is i...DoReadL(TStreamId)const
Opens the requested stream for reading. The function should return a stream buff...DoReclaimL()
Initialises an object for reclaiming space in the store. This function provides ...DoReplaceL(TStreamId)
DoRevertL()
Discards any pending changes to the store. This includes all changes which have ...DoWriteL(TStreamId)
ExtendL()
Generates a new stream within this store, and returns its id. This function can ...ReclaimL()
Reclaims space within a store, returning the total amount of free space availabl...Revert()
Rolls back the store to its state at the last commit point.RevertL()
Rolls back the store to its state at the last commit point and leaves if unsucce...Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...inline TStreamId ExtendL();
Generates a new stream within this store, and returns its id. This function can be used to create a new stream in advance of being written to.
This function is not supported by the direct file store, CDirectFileStore
.
|
IMPORT_C void Delete(TStreamId anId);
Deletes the specified stream from this store.
This function is deprecated.
If unsuccessful, the function fails silently with no way to return information to the user.
The function is not supported by the direct file store, CDirectFileStore
.
|
IMPORT_C void DeleteL(TStreamId anId);
Deletes the specified stream from this store, leaving if unsuccessful.
The function is not supported by the direct file store, CDirectFileStore
.
|
IMPORT_C TInt Commit();
Commits changes.
This function establishes a new commit point. Typically, this is done after changes to new or existing streams are complete and the streams themselves have been committed.
Establishing a new commit point makes changes to the store permanent. Until such changes are committed, they can be rolled back or reverted, effectively causing the store to revert back to its state before the changes were made.
This ensures that persistent data moves from one consistent state to another and guarantees the integrity of persistent store data in the event of failures. In particular, if a process terminates or a media failure occurs, the store reverts automatically to its state at the last successful commit point.
Note that this function is not implemented by the direct file store CDirectFileStore
and the non-persistent in-memory store CBufStore
.
|
CBufStore
...inline void CommitL();
Commit changes and leaves if unsuccessful.
CStreamStore::Commit()
Commits changes.IMPORT_C void Revert();
Rolls back the store to its state at the last commit point.
This function is deprecated; use CStreamStore::RevertL()
instead.
If unsuccessful, the function fails silently with no way to return information to the user.
The function is not supported by the direct file store CDirectFileStore
and the non-persistent in-memory store CBufStore
.
CBufStore
...inline void RevertL();
Rolls back the store to its state at the last commit point and leaves if unsuccessful.
The function is not supported by the direct file store CDirectFileStore
and the non-persistent in-memory store CBufStore
.
CBufStore
...IMPORT_C TInt ReclaimL();
Reclaims space within a store, returning the total amount of free space available within that store.
The function does not return until the reclamation process is complete. This can take an extended amount of time.
The function is only supported by the permanent file store, CPermanentFileStore
, but not by other derived classes, e.g., CDirectFileStore
or CBufStore
.
|
IMPORT_C TInt CompactL();
Compacts the store. This returns free space to the appropriate system pool, for example, the filing system in the case of file-based stores.
On completion, the function returns the total amount of free space available within the store.
The function does not return until the compaction process is complete. This can take an extended amount of time.
Note:
this function is only supported by the permanent file store, CPermanentFileStore
, and not by CDirectFileStore
or CBufStore
.
Streams must be closed before calling this function.
|
private: IMPORT_C virtual TStreamId DoExtendL();
Generates a new stream within this store, and returns its id. This function is intended to create a new stream in advance of being written to.
This is called by CStreamStore::ExtendL()
.
|
CStreamStore::ExtendL()
Generates a new stream within this store, and returns its id. This function can ...private: virtual MStreamBuf* DoReadL(TStreamId anId) const=0;
Opens the requested stream for reading. The function should return a stream buffer positioned at the beginning of this stream.
This function is called by the OpenL() and OpenLC() member functions of RStoreReadStream
.
|
|
RStoreReadStream::OpenL(const CStreamStore &,TStreamId)
Opens and prepares an existing stream for reading. The function leaves if it can...RStoreReadStream::OpenLC(const CStreamStore &,TStreamId)
Opens and prepares an existing stream for reading, leaving a cleanup item on the...private: virtual MStreamBuf* DoCreateL(TStreamId &anId)=0;
Creates a new stream in the store. The function gets the allocated stream id in the anId parameter. A stream buffer for the
stream should be returned, ready to write into the new stream. This provides the implementation for the RStoreWriteStream::CreateL(CStreamStore &)
functions.
|
|
private: IMPORT_C virtual MStreamBuf* DoWriteL(TStreamId anId);
|
|
private: IMPORT_C virtual MStreamBuf* DoReplaceL(TStreamId anId);
|
|
private: IMPORT_C virtual void DoCommitL();
Commits any changes to the store. For a store that provides atomic updates, this writes all of the pending updates to the to the permanent storage medium. After committing the store contains all or none of the updates since the last commit/revert.
This function provides the implementation for the public CStreamStore::CommitL()
function.
private: IMPORT_C virtual void DoRevertL();
Discards any pending changes to the store. This includes all changes which have not been committed to a permanent storage medium.
This function provides the implementation for the public CStreamStore::Revert()
function.
Note:
The function need only be implemented by stores that provide atomic updates, as revert has no meaning for other implementations.
private: IMPORT_C virtual MIncrementalCollector* DoReclaimL();
Initialises an object for reclaiming space in the store. This function provides the direct implementation for RStoreReclaim::OpenL(CStreamStore &,TInt &)
.
Note:
Actually reclaiming the space is done by repeated calls to MIncrementalCollector::Next(), before releasing the object.
|
private: IMPORT_C virtual MIncrementalCollector* DoCompactL();
Initialises an object for compacting space in the store. This function provides the direct implementation for RStoreReclaim::CompactL(CStreamStore &,TInt &)
.
Note:
Actually compacting the space is done by repeated calls to MIncrementalCollector::Next() before releasing the object.
|