|
||
class CEmbeddedStore : public CPersistentStore;
Encapsulates an embedded store.
The embedded store may contain an arbitrarily complex network of streams, but is viewed as simply another stream by the embedding store. This means that the embedded store can dealt with as a single stream for purposes of copying or deleting.
Once streams within the embedded store have been committed and closed, they cannot subsequently be changed, i.e. streams cannot be replaced, deleted, extended or changed in any way.
CBase
-
Base class for all classes to be instantiated on the heap.
CStreamStore
- ...
CPersistentStore
- ...
CEmbeddedStore
-
Encapsulates an embedded store.
Defined in CEmbeddedStore
:
CEmbeddedStore(MStreamBuf *)
ConstructL(RWriteStream &)
Detach()
Gives up ownership of the host stream buffer. The caller takes on the responsibi...DoCommitL()
Commits any changes to the store. For a store that provides atomic updates, this...DoCreateL(TStreamId &)
Creates a new stream in the store. The function gets the allocated stream id in ...DoReadL(TStreamId)const
Opens the requested stream for reading. The function should return a stream buff...DoSetRootL(TStreamId)
Implements the setting of theroot stream.FromL(RReadStream &)
Opens the store hosted by the specified stream.FromLC(RReadStream &)
Open the store hosted by the specified stream, putting a pointer to the store on...Host()const
Returns a pointer to the stream buffer which is acting as host to this embedded ...MarshalL(RReadStream &)
NewL(RWriteStream &)
Creates an embedded store within the specified host stream.NewLC(RWriteStream &)
Creates an embedded store within the specified host stream, putting a pointer to...Position(TStreamId)
Returns the position of the specified stream, within the host stream.Reattach(MStreamBuf *)
Takes ownership of the specified stream buffer. On return from this function, th...Start()const
Returns the start position of this embedded store within the host stream.~CEmbeddedStore()
Frees resources owned by the object, prior to its destruction. In particular, th...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...Inherited from CPersistentStore
:
Root()const
Returns the stream id of the root stream.SetRootL(TStreamId)
Sets the specified stream as the root stream.iRoot
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...IMPORT_C static CEmbeddedStore* NewL(RWriteStream &aHost);
Creates an embedded store within the specified host stream.
Note that ownership of the stream passes to the store and the referenced RWriteStream
is cleared.
|
|
IMPORT_C static CEmbeddedStore* NewLC(RWriteStream &aHost);
Creates an embedded store within the specified host stream, putting a pointer to the store onto the cleanup stack.
Putting a pointer to the embedded store object onto the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent leave occurs.
Note that ownership of the stream passes to the store and the referenced RWriteStream
is cleared.
|
|
IMPORT_C ~CEmbeddedStore();
Frees resources owned by the object, prior to its destruction. In particular, the destructor closes the associated file.
IMPORT_C static CEmbeddedStore* FromL(RReadStream &aHost);
Opens the store hosted by the specified stream.
Note that ownership of the stream passes to the store; the referenced RReadStream
is cleared.
|
|
IMPORT_C static CEmbeddedStore* FromLC(RReadStream &aHost);
Open the store hosted by the specified stream, putting a pointer to the store onto the cleanup stack.
Putting a pointer to the embedded store object onto the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent leave occurs.
Note that ownership of the stream passes to the store and the referenced RReadStream
is cleared.
|
|
static inline TStreamPos Position(TStreamId anId);
Returns the position of the specified stream, within the host stream.
|
|
IMPORT_C void Detach();
Gives up ownership of the host stream buffer. The caller takes on the responsibility for discarding the buffer.
inline void Reattach(MStreamBuf *aHost);
Takes ownership of the specified stream buffer. On return from this function, the embedded store assumes this to be the host stream buffer.
|
inline MStreamBuf* Host() const;
Returns a pointer to the stream buffer which is acting as host to this embedded store. The embedded store retains ownership of the host stream buffer.
|
inline TStreamPos Start() const;
Returns the start position of this embedded store within the host stream.
|
protected: IMPORT_C virtual MStreamBuf* DoReadL(TStreamId anId) const;
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...protected: IMPORT_C virtual MStreamBuf* DoCreateL(TStreamId &anId);
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 void DoSetRootL(TStreamId anId);
Implements the setting of theroot stream.
This function is called by CPersistentStore::SetRootL(TStreamId)
|
CPersistentStore::SetRootL(TStreamId)
Sets the specified stream as the root stream.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.