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 TUintCount()
IMPORT_C CMTPDataProvider &DataProviderByIndexL(TUint)
IMPORT_C CMTPDataProvider &DataProviderL(TUint)
IMPORT_C TIntDeviceDpId()
IMPORT_C TIntDpId(TUint)
IMPORT_C TUintEnumerateState()
voidEnumerationStateChangedL(const CMTPDataProvider &)
IMPORT_C voidExecutePendingRequestL()
IMPORT_C TIntFileDpId()
TBool FreeEnumerationWaiter()
IMPORT_C TBoolIsDataProviderLoaded(TUint)
IMPORT_C voidLoadDataProvidersL()
TMTPOperationalMode Mode()
IMPORT_C TBoolNeedEnumeratingPhase2()
CMTPDataProviderController *NewL()
IMPORT_C voidNotifyDataProvidersL(TMTPNotification, const TAny *)
IMPORT_C voidNotifyDataProvidersL(TUint, TMTPNotification, const TAny *)
IMPORT_C TIntProxyDpId()
IMPORT_C voidRegisterPendingRequestDP(TUint, TUint)
IMPORT_C voidSetNeedEnumeratingPhase2(TBool)
IMPORT_C TUintStorageEnumerateState(TUint)
IMPORT_C voidUnloadDataProviders()
IMPORT_C voidWaitForEnumerationComplete()
Private Member Functions
CMTPDataProviderController()
voidCloseRegistrySessionAndEntryL()
voidConstructL()
CMTPDataProviderConfig *CreateConfigLC(const TDesC &)
voidCreateRegistrySessionAndEntryL()
voidDoCancel()
voidEnumerateDataProviderObjectsL(TUint)
voidEstablishDBSnapshotL(TUint32)
voidImplementationsCleanup(TAny *)
TInt ImplementationsLinearOrderUid(const TUid *, const CImplementationInformation &)
TInt ImplementationsLinearOrderUid(const CImplementationInformation &, const CImplementationInformation &)
TBool IsObjectsEnumerationNeededL(CMTPDataProvider &)
TBool LoadDataProviderL(const TDesC &)
voidLoadInstalledDataProvidersL(const CImplementationInformation *)
TBool LoadROMDataProvidersL(const TDesC &, const RImplInfoPtrArray &)
TInt RunError(TInt)
voidRunL()
voidSchedule()
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
enumTEnumerationStates {
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()

voidCloseRegistrySessionAndEntryL()[private]

ConstructL()

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

Count()

IMPORT_C TUintCount()

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 & aResourceFilenameThe data provider configuration data resource filename.

CreateRegistrySessionAndEntryL()

voidCreateRegistrySessionAndEntryL()[private]

DataProviderByIndexL(TUint)

IMPORT_C CMTPDataProvider &DataProviderByIndexL(TUintaIndex)

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

Parameters

TUint aIndexThe data provider index.

DataProviderL(TUint)

IMPORT_C CMTPDataProvider &DataProviderL(TUintaId)

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

Parameters

TUint aIdThe data provider identifier.

DeviceDpId()

IMPORT_C TIntDeviceDpId()

Provides the identifier of the device data provider.

DoCancel()

voidDoCancel()[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 TIntDpId(TUintaUid)

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

Parameters

TUint aUidThe implementation UID.

EnumerateDataProviderObjectsL(TUint)

voidEnumerateDataProviderObjectsL(TUintaId)[private]

Requests that the given data provider enumerate its objects.

Parameters

TUint aIddata provider ID

EnumerateState()

IMPORT_C TUintEnumerateState()

Provides the enumeration state

EnumerationStateChangedL(const CMTPDataProvider &)

voidEnumerationStateChangedL(const CMTPDataProvider &aDp)

Data provider enumeration state change notification callback.

Parameters

const CMTPDataProvider & aDpThe notifying data provider.

EstablishDBSnapshotL(TUint32)

voidEstablishDBSnapshotL(TUint32aStorage)[private]

Parameters

TUint32 aStorage

ExecutePendingRequestL()

IMPORT_C voidExecutePendingRequestL()

FileDpId()

IMPORT_C TIntFileDpId()

FreeEnumerationWaiter()

TBool FreeEnumerationWaiter()

ImplementationsCleanup(TAny *)

voidImplementationsCleanup(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 * aUidThe implementation UID object to match.
const CImplementationInformation & aObjectThe object instance to match.

ImplementationsLinearOrderUid(const CImplementationInformation &, const CImplementationInformation &)

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

Parameters

const CImplementationInformation & aLThe first object instance.
const CImplementationInformation & aRThe second object instance.

IsDataProviderLoaded(TUint)

IMPORT_C TBoolIsDataProviderLoaded(TUintaId)const

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

Parameters

TUint aIdthe 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 & dpCMTPDataProvider 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 voidLoadDataProvidersL()
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 *)

voidLoadInstalledDataProvidersL(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 * aImplementationsThe 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 & aResourceFilenameThe data provider registration and configuration data resource filename.
const RImplInfoPtrArray & aImplementationsThe ECOM data provider implementations list (ordered by implementation UID).

Mode()

TMTPOperationalMode Mode()

Get the mtpkey mode.

NeedEnumeratingPhase2()

IMPORT_C TBoolNeedEnumeratingPhase2()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 voidNotifyDataProvidersL(TMTPNotificationaNotification,
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 aNotificationThe notification type identifier.
const TAny * aParamsThe notification type specific parameter block

NotifyDataProvidersL(TUint, TMTPNotification, const TAny *)

IMPORT_C voidNotifyDataProvidersL(TUintaDPId,
TMTPNotificationaNotification,
const TAny *aParams
)

Parameters

TUint aDPId
TMTPNotification aNotification
const TAny * aParams

ProxyDpId()

IMPORT_C TIntProxyDpId()

Provides the identifier of the proxy data provider.

RegisterPendingRequestDP(TUint, TUint)

IMPORT_C voidRegisterPendingRequestDP(TUintaDpUid,
TUintaTimeOut = 0
)

Parameters

TUint aDpUid
TUint aTimeOut = 0

RunError(TInt)

TInt RunError(TIntaError)[private, virtual]

Parameters

TInt aError

RunL()

voidRunL()[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()

voidSchedule()[private]

Schedules an enumeration iteration.

SetNeedEnumeratingPhase2(TBool)

IMPORT_C voidSetNeedEnumeratingPhase2(TBoolaNeed)

Parameters

TBool aNeed

StorageEnumerateState(TUint)

IMPORT_C TUintStorageEnumerateState(TUintaStorageId)

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 & aResourceFilenameThe data provider configuration data resource filename.
TUint & aUidOn completion, the implemetation UID.

UnloadDataProviders()

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

WaitForEnumerationComplete()

IMPORT_C voidWaitForEnumerationComplete()

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