CMsvServerEntry Class Reference

#include <mw/msventry.h>

class CMsvServerEntry : public CActive, public MMsvStoreObserver, public CActive, public MMsvStoreObserver
Public Member Functions
~CMsvServerEntry()
IMPORT_C TIntChangeAttributes(const CMsvEntrySelection &, TUint, TUint)
IMPORT_C TIntChangeEntry(const TMsvEntry &, TSecureId)
IMPORT_C TIntChangeEntry(const TMsvEntry &)
IMPORT_C TIntChangeEntryBulk(const TMsvEntry &, TSecureId)
IMPORT_C TIntChangeEntryBulk(const TMsvEntry &)
IMPORT_C voidCompleteBulk()
IMPORT_C voidCopyEntriesL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidCopyEntriesL(const CMsvEntrySelection &, TMsvId, CMsvEntrySelection &, TRequestStatus &)
IMPORT_C voidCopyEntryL(TMsvId, TMsvId, TRequestStatus &)
IMPORT_C voidCopyEntryL(TMsvId, TMsvId, TMsvId &, TRequestStatus &)
IMPORT_C TIntCreateEntry(TMsvEntry &)
IMPORT_C TIntCreateEntry(TMsvEntry &, TSecureId)
IMPORT_C TIntCreateEntry(TMsvEntry &, TSecureId, TBool)
IMPORT_C TIntCreateEntryBulk(TMsvEntry &, TSecureId)
IMPORT_C TIntCreateEntryBulk(TMsvEntry &)
IMPORT_C TIntDeleteEntries(CMsvEntrySelection &)
IMPORT_C TIntDeleteEntry(TMsvId)
IMPORT_C CMsvStore *EditStoreL()
const TMsvEntry &Entry()
IMPORT_C RFs &FileSession()
IMPORT_C TIntGetChildren(CMsvEntrySelection &)
IMPORT_C TIntGetChildrenWithMtm(TUid, CMsvEntrySelection &)
IMPORT_C TIntGetChildrenWithService(TMsvId, CMsvEntrySelection &)
IMPORT_C TIntGetChildrenWithType(TUid, CMsvEntrySelection &)
IMPORT_C TIntGetEntryFromId(TMsvId, TMsvEntry *&)
virtual voidHandleStoreEvent(MMsvStoreObserver::TMsvStoreEvent, TMsvId)
IMPORT_C TBoolHasStoreL()
IMPORT_C voidMoveEntriesL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C TIntMoveEntriesWithinService(CMsvEntrySelection &, TMsvId)
IMPORT_C voidMoveEntryL(TMsvId, TMsvId, TRequestStatus &)
IMPORT_C TIntMoveEntryWithinService(TMsvId, TMsvId)
IMPORT_C CMsvServerEntry *NewEntryL(TMsvId)
IMPORT_C CMsvServerEntry *NewL(CMsvServer &, TMsvId)
IMPORT_C TMsvIdOwningService()
IMPORT_C CMsvStore *ReadStoreL()
IMPORT_C TIntSetEntry(TMsvId)
voidSetMtm(TUid)
voidSetSort(TMsvSelectionOrdering &)
const TMsvSelectionOrdering &Sort()
Protected Member Functions
CMsvServerEntry(CMsvServer &)
voidConstructL(TMsvId)
virtual voidDoCancel()
virtual voidRunL()
Inherited Attributes
CActive::iStatus
Inherited Enumerations
CActive:TPriority
MMsvStoreObserver:TMsvStoreEvent
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()

Detailed Description

Accesses and acts upon a particular Message Server entry.

It provides similar functionality to that which CMsvEntry gives to client-side programs. The current entry that a CMsvServerEntry object relates is similarly referred to as its context.

A difference to note is that CMsvEntry functions, when used on a remote context, can result in requests to Server-side MTMs to change data on a remote server, as well as the local Message Server index. Naturally, as CMsvServerEntry is designed to be used by Server-side MTMs themselves, its comparable functions only alter the Message Server index.

A CBaseServerMTM-derived object gets an initial CMsvServerEntry on construction. It can get further CMsvServerEntry objects by calling NewEntryL(). The context can be changed by SetEntry().

The context is locked, preventing it being accessed by other MTMs. The lock is released when the object is deleted, or the context changes.

As with CMsvEntry, CBaseServerMTM functions can be divided into two broad groups. The first provides means to access the various types of storage associated with an entry. The second provides a means to discover and access other entries that the entry owns (its children).

Constructor & Destructor Documentation

CMsvServerEntry ( CMsvServer & )

CMsvServerEntry(CMsvServer &aIndex)[protected]

~CMsvServerEntry ( )

~CMsvServerEntry()

Frees resources for the object. It:

1. releases the lock on the entry

2. releases the lock on the associated message store if has been opened with EditStoreL()

3. cancels any outstanding asynchronous MoveEntryL() move operation

Member Function Documentation

ChangeAttributes ( const CMsvEntrySelection &, TUint, TUint )

IMPORT_C TIntChangeAttributes(const CMsvEntrySelection &aSelection,
TUintaSetAttributes,
TUintaClearAttributes
)

Provides a quick way to set or clear multiple fields in a selection of entries.

Fields to change are specified using a bitmask of TMsvAttribute values. Possible fields that can be changed using this function are:

1. PC synchronisation

2. Visibility flag

3. Read flag

4. In-preparation flag

5. Connected flag

6. New flag

See also: TMsvAttribute

Parameters
aSelectionThe entries to change
aSetAttributesA bitmask of the fields to set
aClearAttributesA bitmask of the fields to clear
Return Value
KErrNone if successful, otherwise one of the system-wide error codes. KErrNotFound if a specified entry does not exist.

ChangeEntry ( const TMsvEntry &, TSecureId )

IMPORT_C TIntChangeEntry(const TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID.

Parameters
aEntryThe new details for the entry.
aOwnerIdThe ID of the process that should own the entry.
Return Value
KErrNone - success; KErrAccessDenied - the entry is read only (deleted entry, standard folder, or locked); KErrNotSupported - aEntry is invalid or the ID specified in aEntry is not the same as the context ID or no context has been set for the object; KErrNoMemory - a memory allocation failed.

ChangeEntry ( const TMsvEntry & )

IMPORT_C TIntChangeEntry(const TMsvEntry &aEntry)

Sets the context's index entry to the specified values.

Parameters
aEntryThe new details for the entry.
Return Value
KErrNone - success; KErrAccessDenied - the entry is read only (deleted entry, standard folder, or locked); KErrNotSupported - aEntry is invalid or the ID specified in aEntry is not the same as the context ID or no context has been set for the object; KErrNoMemory - a memory allocation failed.

ChangeEntryBulk ( const TMsvEntry &, TSecureId )

IMPORT_C TIntChangeEntryBulk(const TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID. It does this as part of a bulk operation, so the changes are not immediately committed to file.

Parameters
aEntryThe new details for the entry.
aOwnerIdThe ID of the process that should own the entry. Only commits changes to file at specified bulk commit interval.
Return Value
KErrNone - success; KErrAccessDenied - the entry is read only (deleted entry, standard folder, or locked); KErrNotSupported - aEntry is invalid or the ID specified in aEntry is not the same as the context ID or no context has been set for the object; KErrNoMemory - a memory allocation failed.

ChangeEntryBulk ( const TMsvEntry & )

IMPORT_C TIntChangeEntryBulk(const TMsvEntry &aEntry)

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID. It does this as part of a bulk operation, so the changes are not immediately committed to file.

Parameters
aEntryThe new details for the entry.
Return Value
KErrNone - success; KErrAccessDenied - the entry is read only (deleted entry, standard folder, or locked); KErrNotSupported - aEntry is invalid or the ID specified in aEntry is not the same as the context ID or no context has been set for the object; KErrNoMemory - a memory allocation failed.

CompleteBulk ( )

IMPORT_C voidCompleteBulk()

Completes the current bulk transaction (if any) Requests that the message server commit to the index file on disk any entries which have not been committed and to generate notifications for any entries which require them.

Return Value
void

ConstructL ( TMsvId )

voidConstructL(TMsvIdaId)[protected]

CopyEntriesL ( const CMsvEntrySelection &, TMsvId, TRequestStatus & )

IMPORT_C voidCopyEntriesL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
TRequestStatus &aObserverStatus
)

Copies a selection of children of the context to another entry that belongs to a different service. All descendants will be copied as well.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

Parameters
aSelectionThe IDs of the entry to copy. On return, contains the children that could not be fully copied.
aDestinationThe ID of new parent
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of an aSelection entry
KErrInUseThe store or a file associated with an entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundAn aSelection entry is not a child of the context
KErrPathNotFoundThe destination does not exist

CopyEntriesL ( const CMsvEntrySelection &, TMsvId, CMsvEntrySelection &, TRequestStatus & )

IMPORT_C voidCopyEntriesL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
CMsvEntrySelection &aCompletedSelection,
TRequestStatus &aObserverStatus
)

Copies a selection of children of the context to another entry that belongs to a different service. All descendants will be copied as well.

This overload returns the IDs of the new entries.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

Parameters
aSelectionThe IDs of the entry to copy. On return, contains the children that could not be fully copied.
aDestinationThe ID of new parent
aCompletedSelectionOn return, the IDs of the new entries.
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of an aSelection entry
KErrInUseThe store or a file associated with an entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundAn aSelection entry is not a child of the context
KErrPathNotFoundThe destination does not exist

CopyEntryL ( TMsvId, TMsvId, TRequestStatus & )

IMPORT_C voidCopyEntryL(TMsvIdaId,
TMsvIdaDestination,
TRequestStatus &aObserverStatus
)

Copies a child of the context to another entry. All descendants will be copied as well.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

If the function leaves, no changes are made.

Parameters
aIdThe ID of the entry to copy
aDestinationThe ID of new parent
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of an aSelection entry
KErrInUseThe store or a file associated with an entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundAn aSelection entry is not a child of the context
KErrPathNotFoundThe destination does not exist

CopyEntryL ( TMsvId, TMsvId, TMsvId &, TRequestStatus & )

IMPORT_C voidCopyEntryL(TMsvIdaId,
TMsvIdaDestination,
TMsvId &aCompletedEntry,
TRequestStatus &aObserverStatus
)

Copies a child of the context to another entry. All descendants will be copied as well.

This overload returns the ID of the new entry.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

If the function leaves, no changes are made.

Parameters
aIdThe ID of the entry to copy
aDestinationThe ID of new parent
aCompletedEntryOn return, the ID of the new entry
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of an aSelection entry
KErrInUseThe store or a file associated with an entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundAn aSelection entry is not a child of the context
KErrPathNotFoundThe destination does not exist

CreateEntry ( TMsvEntry & )

IMPORT_C TIntCreateEntry(TMsvEntry &aEntry)

Creates a new entry as a child of the current context.

The parent ID and entry ID are set by the Message Server.

Parameters
aEntryIndex entry value for the new entry
Return Value
KErrNone - success; KErrNoMemory - a memory allocation failed; KErrNotSupported - aEntry is invalid

CreateEntry ( TMsvEntry &, TSecureId )

IMPORT_C TIntCreateEntry(TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Creates a new entry as a child of the current context.

Ownership of the created entry is given to the process with the specified SID.

The parent ID and entry ID are set by the Message Server.

Parameters
aEntryIndex entry value for the new entry
aOwnerIdThe SID of the process that will own the create entry.
Return Value
KErrNone - success; KErrNoMemory - a memory allocation failed; KErrNotSupported - aEntry is invalid

CreateEntry ( TMsvEntry &, TSecureId, TBool )

IMPORT_C TIntCreateEntry(TMsvEntry &aEntry,
TSecureIdaOwnerId,
TBoolaBulk
)

Creates a new entry as a child of the current context.

Ownership of the created entry is given to the process with the specified SID.

The parent ID and entry ID are set by the Message Server.

Parameters
aEntryIndex entry value for the new entry
aOwnerIdThe SID of the process that will own the create entry.
aBulkA boolean value to indicate whether this is part of a bulk operation. (ETrue = bulk)
Return Value
KErrNone - success; KErrNoMemory - a memory allocation failed; KErrNotSupported - aEntry is invalid

CreateEntryBulk ( TMsvEntry &, TSecureId )

IMPORT_C TIntCreateEntryBulk(TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Creates a new entry as a child of the current context as part of a bulk creation operation. The entry will not be committed to file immediately.

The parent ID and entry ID are set by the Message Server.

Parameters
aEntryIndex entry value for the new entry
aOwnerIdThe SID of the process that will own the create entry.
Return Value
KErrNone - success; KErrNoMemory - a memory allocation failed; KErrNotSupported - aEntry is invalid

CreateEntryBulk ( TMsvEntry & )

IMPORT_C TIntCreateEntryBulk(TMsvEntry &aEntry)

Creates a new entry as a child of the current context as part of a bulk creation operation

The parent ID and entry ID are set by the Message Server.

Parameters
aEntryIndex entry value for the new entry
Return Value
KErrNone - success; KErrNoMemory - a memory allocation failed; KErrNotSupported - aEntry is invalid

DeleteEntries ( CMsvEntrySelection & )

IMPORT_C TIntDeleteEntries(CMsvEntrySelection &aSelection)

Deletes a selection of child entries. The delete works recursively through all the descendants.

If a child or any descendant is locked by another client, then no entries are deleted.

Parameters
aSelectionThe entries to delete. On return, contains the children that could not be fully deleted
Return Value
KErrNone if successful, KErrAccessDenied if the entry or a descendant was locked by another client, KErrInUse if the store or a file associated with the entry is open, or KErrNotFound if the entry is not a child of the context.

DeleteEntry ( TMsvId )

IMPORT_C TIntDeleteEntry(TMsvIdaId)

Deletes a child entry of the context. The delete works recursively through all the descendants.

If a child or any descendant is locked by another client, then no entries are deleted.

Parameters
aIdThe ID of the entry to delete
Return Value
KErrNone if successful, KErrAccessDenied if the entry or a descendant was locked by another client, KErrInUse if the store or a file associated with the entry is open, or KErrNotFound if the entry is not a child of the context.

DoCancel ( )

voidDoCancel()[protected, virtual]

Reimplemented from CActive::DoCancel()

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

See also: CActive::Cancel

EditStoreL ( )

IMPORT_C CMsvStore *EditStoreL()

Obtains the message store for the current context with read-write access.

Only one client can edit a message store at one time. If another client is already writing to the store, KErrAccessDenied is returned. However, any number of clients can read from the store simultaneously.

If the message store does not exist when EditStore() is called, a new message store is created.

The returned CMsvStore must be deleted when it is no longer required.

Return Value
Context's message store open for read-write access
Leave Codes
KErrAccessDeniedStore is locked by another process or is read-only
KErrNoMemoryNot enough memory to open store

Entry ( )

const TMsvEntry &Entry()const [inline]

FileSession ( )

IMPORT_C RFs &FileSession()

Allows a Server-side MTM to access the file session handle created by the Message Server. This is preferable, as more efficient, to creating another handle.

Return Value
File session handle

GetChildren ( CMsvEntrySelection & )

IMPORT_C TIntGetChildren(CMsvEntrySelection &aSelection)

Gets a selection containing the IDs of all the context children.

If the entry has no children, the selection is empty.

Parameters
aSelectionInitially, this must be an empty selection. On return, it lists the children.
Return Value
KErrNone - success; KErrMemory - a memory allocation failed

GetChildrenWithMtm ( TUid, CMsvEntrySelection & )

IMPORT_C TIntGetChildrenWithMtm(TUidaMtm,
CMsvEntrySelection &aSelection
)

Gets a selection containing the IDs of all the context children with the specified MTM.

If the entry has no children, the selection is empty.

Parameters
aMtmMTM by which to filter children
aSelectionInitially, this must be an empty selection. On return, it lists the children.
Return Value
KErrNone - success; KErrMemory - a memory allocation failed

GetChildrenWithService ( TMsvId, CMsvEntrySelection & )

IMPORT_C TIntGetChildrenWithService(TMsvIdaServiceId,
CMsvEntrySelection &aSelection
)

Gets a selection containing the IDs of all the context children with the specified service.

If the entry has no children, the selection is empty.

Parameters
aServiceIdService by which to filter children
aSelectionInitially, this must be an empty selection. On return, it lists the children.
Return Value
KErrNone - success; KErrMemory - a memory allocation failed

GetChildrenWithType ( TUid, CMsvEntrySelection & )

IMPORT_C TIntGetChildrenWithType(TUidaType,
CMsvEntrySelection &aSelection
)

Gets a selection containing the IDs of all the context children with the specified entry type.

If the entry has no children, the selection is empty.

Parameters
aTypeEntry type by which to filter children
aSelectionInitially, this must be an empty selection. On return, it lists the children.
Return Value
KErrNone - success; KErrMemory - a memory allocation failed

GetEntryFromId ( TMsvId, TMsvEntry *& )

IMPORT_C TIntGetEntryFromId(TMsvIdaId,
TMsvEntry *&aEntry
)

Gets the index entry for a specified entry ID.

Parameters
aIdID of the entry to get
aEntryOn return, a pointer to the index entry with ID aId
Return Value
KErrNone on success; KErrNotFound if the no entry exists with the specified ID

HandleStoreEvent ( MMsvStoreObserver::TMsvStoreEvent, TMsvId )

voidHandleStoreEvent(MMsvStoreObserver::TMsvStoreEventaEvent,
TMsvIdaId
)[virtual]

Receives a message store event.

Parameters
aEventEvent type
aIdID of the message to which the event relates

HasStoreL ( )

IMPORT_C TBoolHasStoreL()const

Tests if the context has an associated message store.

Return Value
ETrue: entry has a message store EFalse: entry does not have a message store

MoveEntriesL ( const CMsvEntrySelection &, TMsvId, TRequestStatus & )

IMPORT_C voidMoveEntriesL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
TRequestStatus &aObserverStatus
)

Moves a selection of children of the context to another entry that belongs to a different service. All descendants will be moved as well.

The move is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the move is complete.

Parameters
aSelectionThe IDs of the entry to move. On return, contains the children that could not be fully moved.
aDestinationThe ID of new parent
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of an aSelection entry
KErrInUseThe store or a file associated with an entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundAn aSelection entry is not a child of the context
KErrPathNotFoundThe destination does not exist

MoveEntriesWithinService ( CMsvEntrySelection &, TMsvId )

IMPORT_C TIntMoveEntriesWithinService(CMsvEntrySelection &aSelection,
TMsvIdaDestination
)

Moves a child of the context to under another entry. All descendants will be moved as well. The destination must belong to the same service as the context.

Parameters
aSelectionThe entries to move. On return, contains the children that could not be fully moved.
aDestinationThe ID of new parent
Return Value
KErrNone if successful, KErrArgument if the destination is a child of aSelection entry, KErrInUse if the store or a file associated with an entry is open, KErrNotFound if an aSelection entry is not a child of the context the, or KErrPathNotFound if the destination does not exist.

MoveEntryL ( TMsvId, TMsvId, TRequestStatus & )

IMPORT_C voidMoveEntryL(TMsvIdaId,
TMsvIdaDestination,
TRequestStatus &aObserverStatus
)

Moves a child of the context to another entry that belongs to a different service. All descendants will be moved as well.

The move is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the move is complete.

If the function leaves, no changes are made.

In pre-Unicode versions an asynchronous move can be cancelled through CancelMoveEntry(); in other releases, use Cancel().

Parameters
aIdThe ID of the entry to move
aDestinationThe ID of new parent
aObserverStatusThe request status to be completed when the operation has finished
Leave Codes
KErrArgumentThe destination is a child of aId
KErrInUseThe store or a file associated with the entry is open
KErrNoMemoryA memory allocation failed
KErrNotFoundaId is not a child of the context
KErrPathNotFoundThe destination does not exist

MoveEntryWithinService ( TMsvId, TMsvId )

IMPORT_C TIntMoveEntryWithinService(TMsvIdaId,
TMsvIdaDestination
)

Moves a child of the context to under another entry. All descendants will be moved as well. The destination must belong to the same service as the context.

If an error occurs, no changes are made.

For pre-Unicode releases see the synchronous overload of MoveEntry().

Parameters
aIdThe ID of the entry to move
aDestinationThe ID of new parent
Return Value
KErrNone if successful, KErrArgument if the destination is a child of aId, KErrInUse if the store or a file associated with the entry is open, KErrNotFound if the aId is not a child of the context KErrPathNotFound, if the destination does not exist.

NewEntryL ( TMsvId )

IMPORT_C CMsvServerEntry *NewEntryL(TMsvIdaId)

Gets a new CMsvServerEntry object for the specified entry ID.

The call locks the entry, preventing it being accessed by other clients.

The object must be deleted when it is no longer required. The lock is released when the object is deleted or the context is changed with SetEntry().

Parameters
aIdID of the entry to access
Return Value
If the function succeeds, this is a pointer to a newly allocated and initialised object.
Leave Codes
KErrLockedEntry is locked
KErrNoMemoryA memory allocation failed
KErrNotFoundThe entry does not exist

NewL ( CMsvServer &, TMsvId )

IMPORT_C CMsvServerEntry *NewL(CMsvServer &aServer,
TMsvIdaId
)[static]

OwningService ( )

IMPORT_C TMsvIdOwningService()const

Gets the ID of the service that owns the context.

Local entries are considered as being members of the local service.

If the entry is the root, then the root ID (KMsvRootIndexEntryId) is returned.

Return Value
ID of the service that owns this entry

ReadStoreL ( )

IMPORT_C CMsvStore *ReadStoreL()

Obtains the message store for the current context with read-only access.

Multiple clients can read from a store simultaneously. If another client is already writing to the store, the function leaves with KErrAccessDenied.

The returned CMsvStore must be deleted when it is no longer required.

Return Value
Context's message store open for read-only access
Leave Codes
KErrAccessDeniedStore is locked by another process
KErrNoMemoryNot enough memory to open store
KErrNotFoundThere is no store associated with this entry

RunL ( )

voidRunL()[protected, virtual]

Reimplemented from CActive::RunL()

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

See also: CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

SetEntry ( TMsvId )

IMPORT_C TIntSetEntry(TMsvIdaId)

Changes the context of the specified entry.

The call locks the entry, preventing it from being accessed by other clients. The lock is released when the object is deleted or the context is changed.

Note that you can change the context to KMsvNullIndexEntryId to unlock an entry without locking another.

Parameters
aIdID of the entry to access
Return Value
KErrNone if successful, KErrNotFound if the entry does not exist, or KErrLocked if the entry is locked.

SetMtm ( TUid )

voidSetMtm(TUidaMtm)[inline]

SetSort ( TMsvSelectionOrdering & )

voidSetSort(TMsvSelectionOrdering &aOrdering)[inline]

Sort ( )

const TMsvSelectionOrdering &Sort()[inline]