CBufStore Class Reference

#include <s32mem.h>

class CBufStore : public CStreamStore

Inherits from

  • CBufStore
    Public Member Functions
    CBufStore(TInt)
    ~CBufStore()
    IMPORT_C CBufStore *NewL(TInt)
    IMPORT_C CBufStore *NewLC(TInt)
    Protected Member Functions
    virtual IMPORT_C MStreamBuf *DoCreateL(TStreamId &)
    virtual IMPORT_C voidDoDeleteL(TStreamId)
    virtual IMPORT_C TStreamIdDoExtendL()
    virtual IMPORT_C MStreamBuf *DoReadL(TStreamId)
    virtual IMPORT_C MStreamBuf *DoReplaceL(TStreamId)
    virtual IMPORT_C MStreamBuf *DoWriteL(TStreamId)
    Inherited Functions
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::Extension_(TUint,TAny *&,TAny *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()
    CStreamStore::Commit()
    CStreamStore::CommitL()
    CStreamStore::CompactL()
    CStreamStore::Delete(TStreamId)
    CStreamStore::DeleteL(TStreamId)
    CStreamStore::ExtendL()
    CStreamStore::ReclaimL()
    CStreamStore::Revert()
    CStreamStore::RevertL()

    Detailed 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.

    Constructor & Destructor Documentation

    CBufStore ( TInt )

    IMPORT_CCBufStore(TIntanExpandSize)

    ~CBufStore ( )

    IMPORT_C~CBufStore()

    Frees resources owned by the object, prior to its destruction.

    Member Function Documentation

    DoCreateL ( TStreamId & )

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

    Reimplemented from CStreamStore::DoCreateL(TStreamId &)

    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
    anIdOn return, contains the allocated stream id.
    Return Value
    The stream buffer to be written to.

    DoDeleteL ( TStreamId )

    IMPORT_C voidDoDeleteL(TStreamIdanId)[protected, virtual]

    Reimplemented from CStreamStore::DoDeleteL(TStreamId)

    DoExtendL ( )

    IMPORT_C TStreamIdDoExtendL()[protected, virtual]

    Reimplemented from CStreamStore::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 ExtendL().

    See also: CStreamStore::ExtendL()

    Return Value
    The new stream id.

    DoReadL ( TStreamId )

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

    Reimplemented from CStreamStore::DoReadL(TStreamId)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.

    See also: RStoreReadStream::OpenL() RStoreReadStream::OpenLC()

    Parameters
    anIdThe stream to be read.
    Return Value
    A stream buffer positioned at the beginning of the stream to be read.

    DoReplaceL ( TStreamId )

    IMPORT_C MStreamBuf *DoReplaceL(TStreamIdanId)[protected, virtual]

    Reimplemented from CStreamStore::DoReplaceL(TStreamId)

    DoWriteL ( TStreamId )

    IMPORT_C MStreamBuf *DoWriteL(TStreamIdanId)[protected, virtual]

    Reimplemented from CStreamStore::DoWriteL(TStreamId)

    NewL ( TInt )

    IMPORT_C CBufStore *NewL(TIntanExpandSize)[static]

    Allocates and constructs a new in-memory store and returns a pointer to it.

    Parameters
    anExpandSizeThe granularity of the buffers used in the implementation of the store. Each stream is contained in a separate CBufSeg buffer.
    Return Value
    A pointer to the memory store object.

    NewLC ( TInt )

    IMPORT_C CBufStore *NewLC(TIntanExpandSize)[static]

    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
    anExpandSizeThe granularity of the buffers used in the implementation of the store. Each stream is contained in a separate CBufSeg buffer.
    Return Value
    A pointer to the memory store object.