CMTPDataProviderController Class Reference

class CMTPDataProviderController : public CActive

Implements the MTP framework data provider controller singleton. This is a container class responsible for loading, storing, and managing CMTPDataProviderPlugin instances and their associated CMTPDataProvider bindings. The ECOM framework is used to load data CMTPDataProviderPlugin instances when instructed to do so by the MTP framework, either on start-up or when a mode switch occurs.

Inherits from

Public Member Functions
~CMTPDataProviderController ()
IMPORT_C TUint Count ()
IMPORT_C CMTPDataProvider & DataProviderByIndexL ( TUint )
IMPORT_C CMTPDataProvider & DataProviderL ( TUint )
IMPORT_C TInt DeviceDpId ()
IMPORT_C TInt DpId ( TUint )
IMPORT_C TUint EnumerateState ()
void EnumerationStateChangedL (const CMTPDataProvider &)
IMPORT_C void ExecutePendingRequestL ()
IMPORT_C TInt FileDpId ()
TBool FreeEnumerationWaiter ()
IMPORT_C TBool IsDataProviderLoaded ( TUint )
IMPORT_C void LoadDataProvidersL ()
TMTPOperationalMode Mode ()
IMPORT_C TBool NeedEnumeratingPhase2 ()
CMTPDataProviderController * NewL ()
IMPORT_C void NotifyDataProvidersL ( TMTPNotification , const TAny *)
IMPORT_C void NotifyDataProvidersL ( TUint , TMTPNotification , const TAny *)
IMPORT_C TInt ProxyDpId ()
IMPORT_C void RegisterPendingRequestDP ( TUint , TUint )
IMPORT_C void SetNeedEnumeratingPhase2 ( TBool )
IMPORT_C TUint StorageEnumerateState ( TUint )
IMPORT_C void UnloadDataProviders ()
IMPORT_C void WaitForEnumerationComplete ()
Private Member Functions
CMTPDataProviderController ()
void CloseRegistrySessionAndEntryL ()
void ConstructL ()
CMTPDataProviderConfig * CreateConfigLC (const TDesC &)
void CreateRegistrySessionAndEntryL ()
void DoCancel ()
void EnumerateDataProviderObjectsL ( TUint )
void EstablishDBSnapshotL ( TUint32 )
void ImplementationsCleanup ( TAny *)
TInt ImplementationsLinearOrderUid (const TUid *, const CImplementationInformation &)
TInt ImplementationsLinearOrderUid (const CImplementationInformation &, const CImplementationInformation &)
TBool IsObjectsEnumerationNeededL ( CMTPDataProvider &)
TBool LoadDataProviderL (const TDesC &)
void LoadInstalledDataProvidersL (const CImplementationInformation *)
TBool LoadROMDataProvidersL (const TDesC &, const RImplInfoPtrArray &)
TInt RunError ( TInt )
void RunL ()
void Schedule ()
TInt Uid (const TDesC &, TUint &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
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()
Public Member Enumerations
enum TEnumerationStates {
EUnenumerated  = 0, EEnumerationStarting  = 1, EEnumeratingFrameworkStorages  = 2, EEnumeratingDataProviderStorages  = 3, EEnumeratingFrameworkObjects  = 4, EEnumeratingDataProviderObjects  = 5, EEnumeratingPhaseOneDone  = 6, EEnumeratingSubDirFiles  = 7, EEnumeratingCleanDBSnapshot  = 8, EEnumeratedFulllyCompleted  = 9
}
Inherited Enumerations
CActive:TPriority
Private Attributes
__FLOG_DECLARATION_MEMBER_MUTABLE
RArray < TUint > iDataProviderIds
RPointerArray < CMTPDataProvider > iDataProviders
TUint iDpIdArrayIndex
TUint iDpIdDeviceDp
TUint iDpIdFileDp
TUint iDpIdProxyDp
RArray < TUint > iEnumeratingDps
RArray < TUint > iEnumeratingStorages
TUint iEnumerationPhase
TEnumerationStates iEnumerationState
TMTPOperationalMode iMode
TBool iNeedEnumeratingPhase2
TUint32 iNeedEnumeratingPhase2StorageId
TUint iNextDpId
CActiveSchedulerWait * iOpenSessionWaiter
TUint iPendingRequestDpUid
CMTPPendingReqestTimer * iPendingRequestTimer
RMTPFramework iSingletons
Swi::RSisRegistryEntry iSisEntry
Swi::RSisRegistrySession iSisSession
TBool iStubFound
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMTPDataProviderController()

CMTPDataProviderController ( ) [private]

Constructor.

~CMTPDataProviderController()

~CMTPDataProviderController ( )

Destructor.

Member Functions Documentation

CloseRegistrySessionAndEntryL()

void CloseRegistrySessionAndEntryL ( ) [private]

ConstructL()

void ConstructL ( ) [private]
Second-phase constructor.
leave
One of the system wide error codes if a processing failure occurs.

Count()

IMPORT_C TUint Count ( )

Provides the number of active data providers.

CreateConfigLC(const TDesC &)

CMTPDataProviderConfig * CreateConfigLC ( const TDesC & aResourceFilename ) [private]
Creates a data provider configurability parameter data instance on the cleanup stack.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const TDesC & aResourceFilename The data provider configuration data resource filename.

CreateRegistrySessionAndEntryL()

void CreateRegistrySessionAndEntryL ( ) [private]

DataProviderByIndexL(TUint)

IMPORT_C CMTPDataProvider & DataProviderByIndexL ( TUint aIndex )

Provides a reference to the data provider with the specified index.

Parameters

TUint aIndex The data provider index.

DataProviderL(TUint)

IMPORT_C CMTPDataProvider & DataProviderL ( TUint aId )

Provides a reference to the data provider with the specified identifier.

Parameters

TUint aId The data provider identifier.

DeviceDpId()

IMPORT_C TInt DeviceDpId ( )

Provides the identifier of the device data provider.

DoCancel()

void DoCancel ( ) [private, virtual]

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

CActive::Cancel

DpId(TUint)

IMPORT_C TInt DpId ( TUint aUid )

Provides the identifier of the data provider with the specified implementation UID.

Parameters

TUint aUid The implementation UID.

EnumerateDataProviderObjectsL(TUint)

void EnumerateDataProviderObjectsL ( TUint aId ) [private]

Requests that the given data provider enumerate its objects.

Parameters

TUint aId data provider ID

EnumerateState()

IMPORT_C TUint EnumerateState ( )

Provides the enumeration state

EnumerationStateChangedL(const CMTPDataProvider &)

void EnumerationStateChangedL ( const CMTPDataProvider & aDp )

Data provider enumeration state change notification callback.

Parameters

const CMTPDataProvider & aDp The notifying data provider.

EstablishDBSnapshotL(TUint32)

void EstablishDBSnapshotL ( TUint32 aStorage ) [private]

Parameters

TUint32 aStorage

ExecutePendingRequestL()

IMPORT_C void ExecutePendingRequestL ( )

FileDpId()

IMPORT_C TInt FileDpId ( )

FreeEnumerationWaiter()

TBool FreeEnumerationWaiter ( )

ImplementationsCleanup(TAny *)

void ImplementationsCleanup ( TAny * aData ) [private, static]

Parameters

TAny * aData

ImplementationsLinearOrderUid(const TUid *, const CImplementationInformation &)

TInt ImplementationsLinearOrderUid ( const TUid * aUid,
const CImplementationInformation & aObject
) [private, static]

Implements a linear order relation for CImplementationInformation objects based on relative CImplementationInformation::ImplementationUid .

Parameters

const TUid * aUid The implementation UID object to match.
const CImplementationInformation & aObject The object instance to match.

ImplementationsLinearOrderUid(const CImplementationInformation &, const CImplementationInformation &)

TInt ImplementationsLinearOrderUid ( const CImplementationInformation & aL,
const CImplementationInformation & aR
) [private, static]

Parameters

const CImplementationInformation & aL The first object instance.
const CImplementationInformation & aR The second object instance.

IsDataProviderLoaded(TUint)

IMPORT_C TBool IsDataProviderLoaded ( TUint aId ) const

Determine whether a data provider with the specified data provider id has been loaded

Parameters

TUint aId the id of the data provider to be checked

IsObjectsEnumerationNeededL(CMTPDataProvider &)

TBool IsObjectsEnumerationNeededL ( CMTPDataProvider & dp ) [private]

Check the necessity of objects enumeration as given the data provider

Parameters

CMTPDataProvider & dp CMTPDataProvider reference

LoadDataProviderL(const TDesC &)

TBool LoadDataProviderL ( const TDesC & aResourceFilename ) [private]
Load data providers
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const TDesC & aResourceFilename

LoadDataProvidersL()

IMPORT_C void LoadDataProvidersL ( )
Loads the set of available data providers and initiates the data provider enumeration sequence.
leave
One of the system wide error codes, if a processing failure occurs.

LoadInstalledDataProvidersL(const CImplementationInformation *)

void LoadInstalledDataProvidersL ( const CImplementationInformation * aImplementations ) [private]
Load all data providers installed on non-ROM drives depending upon the mode and activates the specified ECOM data provider.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const CImplementationInformation * aImplementations The installed ECOM data provider implementations list (ordered by implementation UID).

LoadROMDataProvidersL(const TDesC &, const RImplInfoPtrArray &)

TBool LoadROMDataProvidersL ( const TDesC & aResourceFilename,
const RImplInfoPtrArray & aImplementations
) [private]
Loads the dataprovider on ROM drives depending upon the mode and activates the specified ECOM data provider.
leave
One of the system wide error codes, if a processing failure occurs.

Parameters

const TDesC & aResourceFilename The data provider registration and configuration data resource filename.
const RImplInfoPtrArray & aImplementations The ECOM data provider implementations list (ordered by implementation UID).

Mode()

TMTPOperationalMode Mode ( )

Get the mtpkey mode.

NeedEnumeratingPhase2()

IMPORT_C TBool NeedEnumeratingPhase2 ( ) const

NewL()

CMTPDataProviderController * NewL ( ) [static]
CMTPDataProviderController factory method.
leave
One of the system wide error codes if a processing failure occurs.

NotifyDataProvidersL(TMTPNotification, const TAny *)

IMPORT_C void NotifyDataProvidersL ( TMTPNotification aNotification,
const TAny * aParams
)
Issues the specified notification to all loaded data providers.
leave
One of the system wide error code if a processing failure occurs in the data provider.

Parameters

TMTPNotification aNotification The notification type identifier.
const TAny * aParams The notification type specific parameter block

NotifyDataProvidersL(TUint, TMTPNotification, const TAny *)

IMPORT_C void NotifyDataProvidersL ( TUint aDPId,
TMTPNotification aNotification,
const TAny * aParams
)

Parameters

TUint aDPId
TMTPNotification aNotification
const TAny * aParams

ProxyDpId()

IMPORT_C TInt ProxyDpId ( )

Provides the identifier of the proxy data provider.

RegisterPendingRequestDP(TUint, TUint)

IMPORT_C void RegisterPendingRequestDP ( TUint aDpUid,
TUint aTimeOut = 0
)

Parameters

TUint aDpUid
TUint aTimeOut = 0

RunError(TInt)

TInt RunError ( TInt aError ) [private, virtual]

Parameters

TInt aError

RunL()

void RunL ( ) [private, virtual]

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.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

Schedule()

void Schedule ( ) [private]

Schedules an enumeration iteration.

SetNeedEnumeratingPhase2(TBool)

IMPORT_C void SetNeedEnumeratingPhase2 ( TBool aNeed )

Parameters

TBool aNeed

StorageEnumerateState(TUint)

IMPORT_C TUint StorageEnumerateState ( TUint aStorageId )

Parameters

TUint aStorageId

Uid(const TDesC &, TUint &)

TInt Uid ( const TDesC & aResourceFilename,
TUint & aUid
) [private]

Provides the implemetation UID associated with the specified data provider configuration data resource filename.

Parameters

const TDesC & aResourceFilename The data provider configuration data resource filename.
TUint & aUid On completion, the implemetation UID.

UnloadDataProviders()

IMPORT_C void UnloadDataProviders ( )
Unloads all active data providers.
leave
One of the system wide error codes, if a processing failure occurs.

WaitForEnumerationComplete()

IMPORT_C void WaitForEnumerationComplete ( )

Wait for the enumeration complete.

Member Enumerations Documentation

Enum TEnumerationStates

The active data provider set enumeration states.

Enumerators

EUnenumerated = 0
EEnumerationStarting = 1
EEnumeratingFrameworkStorages = 2
EEnumeratingDataProviderStorages = 3
EEnumeratingFrameworkObjects = 4
EEnumeratingDataProviderObjects = 5
EEnumeratingPhaseOneDone = 6
EEnumeratingSubDirFiles = 7
EEnumeratingCleanDBSnapshot = 8
EEnumeratedFulllyCompleted = 9

Member Data Documentation

__FLOG_DECLARATION_MEMBER_MUTABLE

__FLOG_DECLARATION_MEMBER_MUTABLE [private]

FLOGGER debug trace member variable.

RArray< TUint > iDataProviderIds

RArray < TUint > iDataProviderIds [private]

The active data provider identifier container, ordered by enumeration phase.

RPointerArray< CMTPDataProvider > iDataProviders

RPointerArray < CMTPDataProvider > iDataProviders [private]

The active data provider set container, ordered bit implementation UID.

TUint iDpIdArrayIndex

TUint iDpIdArrayIndex [private]

The index used for iterating through the iDataProviderIds array.

TUint iDpIdDeviceDp

TUint iDpIdDeviceDp [private]

The device data provider identifier.

TUint iDpIdFileDp

TUint iDpIdFileDp [private]

The file data provider identifier.

TUint iDpIdProxyDp

TUint iDpIdProxyDp [private]

The proxy data provider identifier.

RArray< TUint > iEnumeratingDps

RArray < TUint > iEnumeratingDps [private]

The actively enumerating data providers.

RArray< TUint > iEnumeratingStorages

RArray < TUint > iEnumeratingStorages [private]

The actively enumerating storage IDs.

TUint iEnumerationPhase

TUint iEnumerationPhase [private]

The active data provider set enumeration phases.

TEnumerationStates iEnumerationState

TEnumerationStates iEnumerationState [private]

The active data provider set enumeration states.

TMTPOperationalMode iMode

TMTPOperationalMode iMode [private]

Current operation mode

TBool iNeedEnumeratingPhase2

TBool iNeedEnumeratingPhase2 [private]

TUint32 iNeedEnumeratingPhase2StorageId

TUint32 iNeedEnumeratingPhase2StorageId [private]

TUint iNextDpId

TUint iNextDpId [private]

A general purpose index used for iterating through the active data provider set.

CActiveSchedulerWait * iOpenSessionWaiter

CActiveSchedulerWait * iOpenSessionWaiter [private]

opensession waiter

TUint iPendingRequestDpUid

TUint iPendingRequestDpUid [private]

CMTPPendingReqestTimer * iPendingRequestTimer

CMTPPendingReqestTimer * iPendingRequestTimer [private]

RMTPFramework iSingletons

RMTPFramework iSingletons [private]

The framework singletons.

Swi::RSisRegistryEntry iSisEntry

Swi::RSisRegistryEntry iSisEntry [private]

Registry Entry

Swi::RSisRegistrySession iSisSession

Swi::RSisRegistrySession iSisSession [private]

Session for sisRegistry

TBool iStubFound

TBool iStubFound [private]

Stub Found