CEmbeddedStore Class Reference

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.

CPersistentStore

Inherits from

Constructor & Destructor Documentation

CEmbeddedStore(MStreamBuf *)

IMPORT_CCEmbeddedStore(MStreamBuf *aHost)

Parameters

MStreamBuf * aHost

~CEmbeddedStore()

IMPORT_C~CEmbeddedStore()

Member Functions Documentation

ConstructL(RWriteStream &)

IMPORT_C voidConstructL(RWriteStream &aStream)

Parameters

RWriteStream & aStream

Detach()

IMPORT_C voidDetach()

DoCommitL()

IMPORT_C voidDoCommitL()[private, virtual]

DoCreateL(TStreamId &)

IMPORT_C MStreamBuf *DoCreateL(TStreamId &anId)[protected, virtual]

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() functions.

Parameters

TStreamId & anIdOn return, contains the allocated stream id.

DoNewLC(MStreamBuf *)

CEmbeddedStore *DoNewLC(MStreamBuf *aHost)[private, static]

Parameters

MStreamBuf * aHost

DoReadL(TStreamId)

IMPORT_C MStreamBuf *DoReadL(TStreamIdanId)const [protected, virtual]

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() RStoreReadStream::OpenLC()

Parameters

TStreamId anIdThe stream to be read.

DoSetRootL(TStreamId)

IMPORT_C voidDoSetRootL(TStreamIdanId)[private, virtual]

Parameters

TStreamId anId

FromL(RReadStream &)

IMPORT_C CEmbeddedStore *FromL(RReadStream &aHost)[static]

Parameters

RReadStream & aHost

FromLC(RReadStream &)

IMPORT_C CEmbeddedStore *FromLC(RReadStream &aHost)[static]

Parameters

RReadStream & aHost

Host()

MStreamBuf *Host()const [inline]

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.

MarshalL(RReadStream &)

IMPORT_C voidMarshalL(RReadStream &aStream)

Parameters

RReadStream & aStream

NewL(RWriteStream &)

IMPORT_C CEmbeddedStore *NewL(RWriteStream &aHost)[static]

Parameters

RWriteStream & aHost

NewLC(RWriteStream &)

IMPORT_C CEmbeddedStore *NewLC(RWriteStream &aHost)[static]

Parameters

RWriteStream & aHost

Position(TStreamId)

TStreamPos Position(TStreamIdanId)[static, inline]

Returns the position of the specified stream, within the host stream.

Parameters

TStreamId anIdThe stream id of the stream in the embedded store whose position within the host stream is to be returned.

Reattach(MStreamBuf *)

voidReattach(MStreamBuf *aHost)[inline]

Takes ownership of the specified stream buffer. On return from this function, the embedded store assumes this to be the host stream buffer.

Parameters

MStreamBuf * aHostA pointer to the stream buffer over which the embedded store is to take ownership.

Start()

TStreamPos Start()const [inline]

Returns the start position of this embedded store within the host stream.

Member Data Documentation

__MUTABLE TStreamExchange iHost

__MUTABLE TStreamExchangeiHost[private]

TStreamPos iStart

TStreamPos iStart[private]