#include <S32MEM.H>
Link against:
estor.lib
class CBufStore : public CStreamStore;
Description
In-memory non-persistent store. The buffer store does not have a root stream and cannot be closed without losing all the data.
It implements many of the operations defined by the store abstract framework. Specifically, streams in this store can be:
overwritten, replaced, appended, deleted, and created in advance of being written to. However the class does not support commit
and revert operations.
Overwriting an existing stream can result in a shorter stream; however, a stream cannot be extended beyond its original length.
Replacing a stream can result in a stream which is longer or shorter than the original. The order in which streams are written
to a memory store is not important as streams can be changed and rewritten.
Derivation
CBase
-
Base class for all classes to be instantiated on the heap.
Members
Defined in CBufStore
:
Inherited from CBase
:
Inherited from 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.
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...
Construction and destruction
IMPORT_C static CBufStore* NewL(TInt anExpandSize);
Description
Allocates and constructs a new in-memory store and returns a pointer to it.
Parameters
TInt anExpandSize |
The granularity of the buffers used in the implementation of the store. Each stream is contained in a separate CBufSeg buffer.
|
|
Return value
CBufStore *
|
A pointer to the memory store object.
|
|
IMPORT_C static CBufStore* NewLC(TInt anExpandSize);
Description
Allocates and constructs a new in-memory store and returns a pointer to it, putting a pointer to the object onto the cleanup
stack.
Putting a pointer to the object on the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent
leave occurs.
Parameters
TInt anExpandSize |
The granularity of the buffers used in the implementation of the store. Each stream is contained in a separate CBufSeg buffer.
|
|
Return value
CBufStore *
|
A pointer to the memory store object.
|
|
IMPORT_C CBufStore(TInt anExpandSize);
Description
Parameters
IMPORT_C ~CBufStore();
Description
Frees resources owned by the object, prior to its destruction.
protected: IMPORT_C virtual TStreamId DoExtendL();
Description
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()
.
Return value
See also:
protected: IMPORT_C virtual void DoDeleteL(TStreamId anId);
Description
Parameters
protected: IMPORT_C virtual MStreamBuf* DoReadL(TStreamId anId) const;
Description
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
.
Parameters
Return value
MStreamBuf *
|
A stream buffer positioned at the beginning of the stream to be read.
|
|
See also:
protected: IMPORT_C virtual MStreamBuf* DoCreateL(TStreamId &anId);
Description
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.
Parameters
TStreamId &anId |
On return, contains the allocated stream id.
|
|
Return value
protected: IMPORT_C virtual MStreamBuf* DoWriteL(TStreamId anId);
Description
Parameters
Return value
protected: IMPORT_C virtual MStreamBuf* DoReplaceL(TStreamId anId);
Description
Parameters
Return value