CMTPDataProvider Class Reference

class CMTPDataProvider : public CActive

Implements the API portion of the API/SPI interface pair by which MTP framework and data provider plug-ins interact. A unique CMTPDataProvider instance is created and bound to each CMTPDataProviderPlugin instance that is loaded, and functions on its behalf to: a) Process MTP operational and media object data to and from the MTP framework, and; b) Manage MTP transaction protocol state transitions to ensure that the MTP transaction state remains valid under both normal and error recovery processing conditions.

Inherits from

Nested Classes and Structures

Public Member Functions
~CMTPDataProvider()
MMTPDataCodeGenerator &DataCodeGenerator()
const MMTPDataProviderConfig &DataProviderConfig()
TUint DataProviderId()
voidEnumerateObjectsL(TUint32)
voidEnumerateStoragesL()
IMPORT_C TUintEnumerationState()
voidExecuteEventL(const TMTPTypeEvent &, MMTPConnection &)
voidExecutePendingRequestL()
IMPORT_C voidExecuteProxyRequestL(const TMTPTypeRequest &, MMTPConnection &, MMTPTransactionProxy &)
voidExecuteRequestL(const TMTPTypeRequest &, MMTPConnection &)
const MMTPFrameworkConfig &FrameworkConfig()
RFs &Fs()
IMPORT_C TUidImplementationUid()
TInt LinearOrderDPId(const TUint *, const CMTPDataProvider &)
TInt LinearOrderDPId(const CMTPDataProvider &, const CMTPDataProvider &)
TInt LinearOrderEnumerationPhase(const CMTPDataProvider &, const CMTPDataProvider &)
TInt LinearOrderUid(const TUid *, const CMTPDataProvider &)
TInt LinearOrderUid(const CMTPDataProvider &, const CMTPDataProvider &)
TMTPOperationalMode Mode()
CMTPDataProvider *NewL(TUint, TUid, CMTPDataProviderConfig *)
CMTPDataProvider *NewLC(TUint, TUid, CMTPDataProviderConfig *)
voidNotifyFrameworkL(TMTPNotificationToFramework, const TAny *)
voidObjectEnumerationCompleteL(TUint32)
MMTPObjectMgr &ObjectMgr()
IMPORT_C CMTPDataProviderPlugin &Plugin()
voidReceiveDataL(MMTPType &, const TMTPTypeRequest &, MMTPConnection &)
MMTPReferenceMgr &ReferenceMgr()
voidRegisterPendingRequest(TUint)
voidRouteRequestRegisterL(const TMTPTypeRequest &, MMTPConnection &)
voidRouteRequestUnregisterL(const TMTPTypeRequest &, MMTPConnection &)
voidSendDataL(const MMTPType &, const TMTPTypeRequest &, MMTPConnection &)
voidSendEventL(const TMTPTypeEvent &, MMTPConnection &)
voidSendEventL(const TMTPTypeEvent &)
voidSendResponseL(const TMTPTypeResponse &, const TMTPTypeRequest &, MMTPConnection &)
voidSetDataProviderId(TUint)
voidStorageEnumerationCompleteL()
MMTPStorageMgr &StorageMgr()
IMPORT_C TBoolSupported(TMTPSupportCategory, TUint)
IMPORT_C const RArray< TUint > &SupportedCodes(TMTPSupportCategory)
voidTransactionCompleteL(const TMTPTypeRequest &, MMTPConnection &)
Private Member Functions
CMTPDataProvider(TUint, TUid, CMTPDataProviderConfig *)
voidConstructL()
voidDoCancel()
TInt RunError(TInt)
voidRunL()
voidSchedule()
voidSendErrorResponseL(TInt)
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 = 0x00000000, EObjectsEnumerationState = 0x0000000F, EObjectsEnumerating = 0x00000003, EObjectsEnumerated = 0x00000001, EStoragesEnumerationState = 0x000000F0, EStoragesEnumerating = 0x00000030, EStoragesEnumerated = 0x00000010, EEnumerated = (EStoragesEnumerated | EObjectsEnumerated)
}
Inherited Enumerations
CActive:TPriority
Private Attributes
__FLOG_DECLARATION_MEMBER_MUTABLE
CMTPDataProviderConfig *iConfig
TBool iConstructed
CMTPConnection *iCurrentConnection
const TMTPTypeRequest *iCurrentRequest
TMTPTransactionPhase iCurrentTransactionPhase
TUint iEnumerationState
TInt iErrorRecovery
TInt iId
CMTPDataProviderPlugin *iImplementation
TUid iImplementationUid
MMTPTransactionProxy *iProxy
TMTPTransactionPhase iProxyTransactionPhase
TMTPTypeResponse iResponse
RMTPFramework iSingletons
RPointerArray< CSupportedCodes >iSupported
RTimer iTimer
TBool iTimerActive
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMTPDataProvider(TUint, TUid, CMTPDataProviderConfig *)

CMTPDataProvider(TUintaId,
TUidaImplementationUid,
CMTPDataProviderConfig *aConfig
)[private]

Constructor.

Parameters

TUint aIdThe data provider identifier.
TUid aImplementationUidThe data provider implementation UID.
CMTPDataProviderConfig * aConfigThe data provider configurability parameter data. Ownership IS transfered.

~CMTPDataProvider()

~CMTPDataProvider()

Destructor.

Member Functions Documentation

ConstructL()

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

DataCodeGenerator()

MMTPDataCodeGenerator &DataCodeGenerator()const

DataProviderConfig()

const MMTPDataProviderConfig &DataProviderConfig()const

DataProviderId()

TUint DataProviderId()const

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

EnumerateObjectsL(TUint32)

voidEnumerateObjectsL(TUint32aStorageId)

Parameters

TUint32 aStorageId

EnumerateStoragesL()

voidEnumerateStoragesL()

EnumerationState()

IMPORT_C TUintEnumerationState()const

Provides the data provider's enumeration state.

ExecuteEventL(const TMTPTypeEvent &, MMTPConnection &)

voidExecuteEventL(const TMTPTypeEvent &aEvent,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeEvent & aEvent
MMTPConnection & aConnection

ExecutePendingRequestL()

voidExecutePendingRequestL()

ExecuteProxyRequestL(const TMTPTypeRequest &, MMTPConnection &, MMTPTransactionProxy &)

IMPORT_C voidExecuteProxyRequestL(const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection,
MMTPTransactionProxy &aProxy
)

Parameters

const TMTPTypeRequest & aRequest
MMTPConnection & aConnection
MMTPTransactionProxy & aProxy

ExecuteRequestL(const TMTPTypeRequest &, MMTPConnection &)

voidExecuteRequestL(const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

FrameworkConfig()

const MMTPFrameworkConfig &FrameworkConfig()const

Fs()

RFs &Fs()const

ImplementationUid()

IMPORT_C TUidImplementationUid()const

Provides the data provider's implementation UID

LinearOrderDPId(const TUint *, const CMTPDataProvider &)

TInt LinearOrderDPId(const TUint *aDPId,
const CMTPDataProvider &aObject
)[static]

Implements a TLinearOrder for CMTPDataProvider objects based on relative CMTPDataProvider::DataProviderId.

Parameters

const TUint * aDPIdThe Dataprovider ID to match.
const CMTPDataProvider & aObject

LinearOrderDPId(const CMTPDataProvider &, const CMTPDataProvider &)

TInt LinearOrderDPId(const CMTPDataProvider &aL,
const CMTPDataProvider &aR
)[static]

Implements a TLinearOrder for CMTPDataProvider objects based on relative CMTPDataProvider::DataProviderId.

Parameters

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

LinearOrderEnumerationPhase(const CMTPDataProvider &, const CMTPDataProvider &)

TInt LinearOrderEnumerationPhase(const CMTPDataProvider &aL,
const CMTPDataProvider &aR
)[static]

Implements a TLinearOrder for CMTPDataProvider objects based on relative enumeration phase

Parameters

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

LinearOrderUid(const TUid *, const CMTPDataProvider &)

TInt LinearOrderUid(const TUid *aUid,
const CMTPDataProvider &aObject
)[static]

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

Parameters

const TUid * aUidThe implementation UID object to match.
const CMTPDataProvider & aObjectThe object instance to match.

LinearOrderUid(const CMTPDataProvider &, const CMTPDataProvider &)

TInt LinearOrderUid(const CMTPDataProvider &aL,
const CMTPDataProvider &aR
)[static]

Implements a TLinearOrder for CMTPDataProvider objects based on relative CMTPDataProvider::ImplementationUid.

Parameters

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

Mode()

TMTPOperationalMode Mode()const

NewL(TUint, TUid, CMTPDataProviderConfig *)

CMTPDataProvider *NewL(TUintaId,
TUidaImplementationUid,
CMTPDataProviderConfig *aConfig
)[static]
CMTPDataProvider factory method.
leave
One of the system wide error codes if a processing failure occurs.

Parameters

TUint aIdThe data provider identifier.
TUid aImplementationUidThe data provider implementation UID.
CMTPDataProviderConfig * aConfigThe data provider configurability parameter data. Ownership IS transfered.

NewLC(TUint, TUid, CMTPDataProviderConfig *)

CMTPDataProvider *NewLC(TUintaId,
TUidaImplementationUid,
CMTPDataProviderConfig *aConfig
)[static]
CMTPDataProvider factory method. A pointer to the CMTPDataProvider instance is placed on the cleanup stack.
leave
One of the system wide error codes if a processing failure occurs.

Parameters

TUint aId
TUid aImplementationUidThe data provider implementation UID.
CMTPDataProviderConfig * aConfigThe data provider configurability parameter data. Ownership IS transfered.

NotifyFrameworkL(TMTPNotificationToFramework, const TAny *)

voidNotifyFrameworkL(TMTPNotificationToFrameworkaNotification,
const TAny *aParams
)

Parameters

TMTPNotificationToFramework aNotification
const TAny * aParams

ObjectEnumerationCompleteL(TUint32)

voidObjectEnumerationCompleteL(TUint32aStorageId)

Parameters

TUint32 aStorageId

ObjectMgr()

MMTPObjectMgr &ObjectMgr()const

Plugin()

IMPORT_C CMTPDataProviderPlugin &Plugin()const

Provides the handle of the bound data provider plug-in.

ReceiveDataL(MMTPType &, const TMTPTypeRequest &, MMTPConnection &)

voidReceiveDataL(MMTPType &aData,
const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

MMTPType & aData
const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

ReferenceMgr()

MMTPReferenceMgr &ReferenceMgr()const

RegisterPendingRequest(TUint)

voidRegisterPendingRequest(TUintaTimeOut = 0)

Parameters

TUint aTimeOut = 0

RouteRequestRegisterL(const TMTPTypeRequest &, MMTPConnection &)

voidRouteRequestRegisterL(const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

RouteRequestUnregisterL(const TMTPTypeRequest &, MMTPConnection &)

voidRouteRequestUnregisterL(const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

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 the next request phase or event.

SendDataL(const MMTPType &, const TMTPTypeRequest &, MMTPConnection &)

voidSendDataL(const MMTPType &aData,
const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const MMTPType & aData
const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

SendErrorResponseL(TInt)

voidSendErrorResponseL(TIntaError)[private]
Formats and sends an MTP response dataset from the specified error code.
leave
One of the system wide error codes, if a processing error occurs.

Parameters

TInt aErrorThe error code.

SendEventL(const TMTPTypeEvent &, MMTPConnection &)

voidSendEventL(const TMTPTypeEvent &aEvent,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeEvent & aEvent
MMTPConnection & aConnection

SendEventL(const TMTPTypeEvent &)

voidSendEventL(const TMTPTypeEvent &aEvent)

Parameters

const TMTPTypeEvent & aEvent

SendResponseL(const TMTPTypeResponse &, const TMTPTypeRequest &, MMTPConnection &)

voidSendResponseL(const TMTPTypeResponse &aResponse,
const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeResponse & aResponse
const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

SetDataProviderId(TUint)

voidSetDataProviderId(TUintaId)

Sets the

Parameters

TUint aId

StorageEnumerationCompleteL()

voidStorageEnumerationCompleteL()

StorageMgr()

MMTPStorageMgr &StorageMgr()const

Supported(TMTPSupportCategory, TUint)

IMPORT_C TBoolSupported(TMTPSupportCategoryaCategory,
TUintaCode
)const

Parameters

TMTPSupportCategory aCategory
TUint aCode

SupportedCodes(TMTPSupportCategory)

IMPORT_C const RArray< TUint > &SupportedCodes(TMTPSupportCategoryaCategory)const

Parameters

TMTPSupportCategory aCategory

TransactionCompleteL(const TMTPTypeRequest &, MMTPConnection &)

voidTransactionCompleteL(const TMTPTypeRequest &aRequest,
MMTPConnection &aConnection
)

Parameters

const TMTPTypeRequest & aRequest
MMTPConnection & aConnection

Member Enumerations Documentation

Enum TEnumerationStates

The enumeration state bit flags.

Enumerators

EUnenumerated = 0x00000000
EObjectsEnumerationState = 0x0000000F
EObjectsEnumerating = 0x00000003
EObjectsEnumerated = 0x00000001
EStoragesEnumerationState = 0x000000F0
EStoragesEnumerating = 0x00000030
EStoragesEnumerated = 0x00000010
EEnumerated = (EStoragesEnumerated | EObjectsEnumerated)

Member Data Documentation

__FLOG_DECLARATION_MEMBER_MUTABLE

__FLOG_DECLARATION_MEMBER_MUTABLE[private]

FLOGGER debug trace member variable.

CMTPDataProviderConfig * iConfig

CMTPDataProviderConfig *iConfig[private]

The data provider configurability parameter data.

TBool iConstructed

TBool iConstructed[private]

The construction completed flag. This is used to indicate that ownership of passed objects has been assumed.

CMTPConnection * iCurrentConnection

CMTPConnection *iCurrentConnection[private]

The MTP connection on which the currently active operation is being processed.

const TMTPTypeRequest * iCurrentRequest

const TMTPTypeRequest *iCurrentRequest[private]

The MTP request dataset buffer.

TMTPTransactionPhase iCurrentTransactionPhase

TMTPTransactionPhase iCurrentTransactionPhase[private]

The transaction phase of the currently active operation.

TUint iEnumerationState

TUint iEnumerationState[private]

The enumeration state.

TInt iErrorRecovery

TInt iErrorRecovery[private]

The error recovery flag, indicating that an error occurred while processing a request.

TInt iId

TInt iId[private]

The data provider identifier.

CMTPDataProviderPlugin * iImplementation

CMTPDataProviderPlugin *iImplementation[private]

The data provider implementation plug-in.

TUid iImplementationUid

TUid iImplementationUid[private]

The data provider implementation UID.

MMTPTransactionProxy * iProxy

MMTPTransactionProxy *iProxy[private]

The currently active transaction proxy.

TMTPTransactionPhase iProxyTransactionPhase

TMTPTransactionPhase iProxyTransactionPhase[private]

The transaction phase of the currently active transaction proxy.

TMTPTypeResponse iResponse

TMTPTypeResponse iResponse[private]

The MTP response dataset buffer.

RMTPFramework iSingletons

RMTPFramework iSingletons[private]

The framework singletons.

RPointerArray< CSupportedCodes > iSupported

RPointerArray< CSupportedCodes >iSupported[private]

The data provider's support categories table.

RTimer iTimer

RTimer iTimer[private]

TBool iTimerActive

TBool iTimerActive[private]

Indicates whether iTimer is active.