CMTPObjectStore Class Reference

class CMTPObjectStore : public CBase

Implements the MTP object meta data store, which manages the storage/mapping of object handle and suid, and puid using DMBS. Note, the CMTPObjectMgr acts as a shim class which forwards all the requests to the CMTPObjectStore. The reason is that later on, the class CMTPObjectStore will also implement the reference manager and puid manager functionalities. Having a single class implements all these will enable us to use a single database with multiple tables.

Inherits from

Public Member Functions
~CMTPObjectStore()
voidBeginTransactionL()
voidCalcFreeHandlesL(TUint)
voidCleanDBSnapshotL(TBool)
voidCleanL()
voidCommitReservedObjectHandleL(CMTPObjectMetaData &)
voidCommitTransactionL()
TUint CountL(const TMTPObjectMgrQueryParams &)
CMTPDPIDStore &DPIDStore()
RDbDatabase &Database()
voidEstablishDBSnapshotL(TUint32)
voidGetObjectHandlesL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, RArray< TUint > &)
voidGetObjectSuidsL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, CDesCArray &)
TUint32 HandleL(const TDesC &)
TUint32 HandleL(TUint32, const TDesC &)
voidIncTranOpsNumL()
voidInsertObjectL(CMTPObjectMetaData &)
voidInsertObjectsL(RPointerArray< CMTPObjectMetaData > &)
TBool IsMediaFormat(TUint32)
voidMarkDPLoadedL(TUint, TBool)
voidMarkNonPersistentObjectsL(TUint, TUint32)
voidModifyObjectL(const CMTPObjectMetaData &)
CMtpDeltaDataMgr *MtpDeltaDataMgr()
CMTPObjectStore *NewL()
TBool ObjectExistsL(const TUint32)
TBool ObjectL(const TMTPTypeUint32 &, CMTPObjectMetaData &)
TBool ObjectL(const TDesC &, CMTPObjectMetaData &)
TUint ObjectOwnerId(const TMTPTypeUint32 &)
const TPtrCObjectSuidL(TUint32)
voidObjectsEnumComplete()
CMTPPkgIDStore &PkgIDStore()
TMTPTypeUint128 PuidL(const TUint32)
TMTPTypeUint128 PuidL(const TDesC &)
CMTPReferenceMgr &ReferenceMgr()
voidRemoveNonPersistentObjectsL(TUint)
voidRemoveObjectL(const TMTPTypeUint32 &)
voidRemoveObjectL(const TDesC &)
voidRemoveObjectsByStorageIdL(TUint32)
voidRemoveObjectsL(const CDesCArray &)
voidRemoveObjectsL(TUint)
voidRemoveUndefinedObjectsL()
voidReserveObjectHandleL(CMTPObjectMetaData &, TUint64)
voidRestorePersistentObjectsL(TUint)
voidTraverseL(const TMTPObjectMgrQueryParams &, MTraverseAction &)
voidUnreserveObjectHandleL(const CMTPObjectMetaData &)
Private Member Functions
CMTPObjectStore()
voidBuildObjectMetaDataL(CMTPObjectMetaData &, const RDbTable &)
voidCloseDb()
voidConstructL()
voidCreateDbL(const TDesC &)
voidCreateHandleIndexL()
voidCreateHandleTableL()
voidCreateStorageIndexL()
voidCreateStorageTableL()
voidDBUpdateFailRecover(TAny *)
voidDbColReadStreamL(const RDbTable &, TDbColNo, TDes16 &)
voidDbColWriteStreamL(RDbTable &, TDbColNo, const TDesC16 &)
TBool FilterObject(const RDbTable &, const TUint32, const TUint32, const TUint32)
voidGetFullPathName(const TDesC &, TFileName &)
TBool GetObjectL(TUint32, CMTPObjectMetaData &)
voidInitializeDbL()
TBool IsInvalidHandle(TUint32)
TBool LocateByHandleL(const TUint, const TBool)
TBool LocateBySuidL(const TDesC &)
TInt OpenDb(const TDesC &)
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()
Private Member Enumerations
enumTObjectStore {
EObjectStoreHandleId = 1, EObjectStoreSUIDHash = 2, EObjectStoreSUID = 3, EObjectStoreDataProviderId = 4, EObjectStoreFormatCode = 5, EObjectStoreFormatSubCode = 6, EObjectStoreStorageId = 7, EObjectStoreModes = 8, EObjectStorePOUID = 9, EObjectStoreParentHandle = 10, EObjectStoreDPFlag = 11, EObjectStoreNonConsumable = 12, EObjectStoreName = 13
}
Private Attributes
const TUintKQueryWindowForeSlots
const TUintKQueryWindowRearSlots
__FLOG_DECLARATION_MEMBER_MUTABLE
RDbTable iBatched
RDbTable iBatched_SuidHashID
TBool iCacheExist
TUint32 iCachedHandle
TUint32 iCachedSuidHash
TBool iCleanUndefined
CDbCompactor *iCompactor
CMTPDPIDStore *iDPIDStore
RDbNamedDatabase iDatabase
RPointerArray< CEnumertingCacheItem >iEnumeratingCacheObjList
CMTPHandleAllocator *iHandleAllocator
TUint32 iMaxCommitLimit
TUint32 iMaxCompactLimit
CMtpDeltaDataMgr *iMtpDeltaDataMgr
RArray< TUint >iNonPersistentDPList
CMTPPkgIDStore *iPkgIDStore
CMTPReferenceMgr *iReferenceMgr
CEnumertingCacheItem *iSentinal
RMTPFramework iSingletons
TInt iSnapshotCleanPos
CSnapshotWorker *iSnapshotWorker
TBuf< KMTPMaxSqlStatementLen >iSqlStatement
TFileName iSuidBuf
TUint32 iTransactionOps
TBool iUpdateDeltaDataTable

Constructor & Destructor Documentation

CMTPObjectStore()

CMTPObjectStore()[private]

Standard c++ constructor

~CMTPObjectStore()

~CMTPObjectStore()

Destructor.

Member Functions Documentation

BeginTransactionL()

voidBeginTransactionL()

BuildObjectMetaDataL(CMTPObjectMetaData &, const RDbTable &)

voidBuildObjectMetaDataL(CMTPObjectMetaData &aBuf,
const RDbTable &aTable
)const [private]

Parameters

CMTPObjectMetaData & aBuf
const RDbTable & aTable

CalcFreeHandlesL(TUint)

voidCalcFreeHandlesL(TUintaDataProviderId)

Parameters

TUint aDataProviderId

CleanDBSnapshotL(TBool)

voidCleanDBSnapshotL(TBoolaOnlyRoot = EFalse)

Parameters

TBool aOnlyRoot = EFalse

CleanL()

voidCleanL()

Clean unloaded data provider contents from object store

CloseDb()

voidCloseDb()[private]

Close the current opened database

CommitReservedObjectHandleL(CMTPObjectMetaData &)

voidCommitReservedObjectHandleL(CMTPObjectMetaData &aObject)

Parameters

CMTPObjectMetaData & aObject

CommitTransactionL()

voidCommitTransactionL()

ConstructL()

voidConstructL()[private]

Second phase constructor.

CountL(const TMTPObjectMgrQueryParams &)

TUint CountL(const TMTPObjectMgrQueryParams &aParams)const

Parameters

const TMTPObjectMgrQueryParams & aParams

CreateDbL(const TDesC &)

voidCreateDbL(const TDesC &aFileName)[private]

Create the database with the specified database name

Parameters

const TDesC & aFileNameThe name of the database to create

CreateHandleIndexL()

voidCreateHandleIndexL()[private]

Create three index on the table: 1. Handle, 2. SuidHash, 3. ParentHandle

CreateHandleTableL()

voidCreateHandleTableL()[private]

Create the table for storing the mapping from object handle to other properties (data provider id, storage id, formatcode, etc.)

CreateStorageIndexL()

voidCreateStorageIndexL()[private]

CreateStorageTableL()

voidCreateStorageTableL()[private]

DBUpdateFailRecover(TAny *)

voidDBUpdateFailRecover(TAny *aTable)[private, static]

Parameters

TAny * aTable

DPIDStore()

CMTPDPIDStore &DPIDStore()const

Provides a reference to the DPID store object.

Database()

RDbDatabase &Database()

Provides a reference to the object meta data store database.

DbColReadStreamL(const RDbTable &, TDbColNo, TDes16 &)

voidDbColReadStreamL(const RDbTable &aTable,
TDbColNoaCol,
TDes16 &aDes
)const [private]

Parameters

const RDbTable & aTable
TDbColNo aCol
TDes16 & aDes

DbColWriteStreamL(RDbTable &, TDbColNo, const TDesC16 &)

voidDbColWriteStreamL(RDbTable &aTable,
TDbColNoaCol,
const TDesC16 &aDes
)[private]

Parameters

RDbTable & aTable
TDbColNo aCol
const TDesC16 & aDes

EstablishDBSnapshotL(TUint32)

voidEstablishDBSnapshotL(TUint32aStorageId)

Parameters

TUint32 aStorageId

FilterObject(const RDbTable &, const TUint32, const TUint32, const TUint32)

TBool FilterObject(const RDbTable &aCurrRow,
const TUint32aStorageID,
const TUint32aFormatCode,
const TUint32aDpID
)const [private]

Parameters

const RDbTable & aCurrRow
const TUint32 aStorageID
const TUint32 aFormatCode
const TUint32 aDpID

GetFullPathName(const TDesC &, TFileName &)

voidGetFullPathName(const TDesC &aName,
TFileName &aFileName
)const [private]

Get the full path of the database

Parameters

const TDesC & aName
TFileName & aFileNameThe file name of the database to be retrieved

GetObjectHandlesL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, RArray< TUint > &)

voidGetObjectHandlesL(const TMTPObjectMgrQueryParams &aParams,
RMTPObjectMgrQueryContext &aContext,
RArray< TUint > &aHandles
)const

Parameters

const TMTPObjectMgrQueryParams & aParams
RMTPObjectMgrQueryContext & aContext
RArray< TUint > & aHandles

GetObjectL(TUint32, CMTPObjectMetaData &)

TBool GetObjectL(TUint32aHandle,
CMTPObjectMetaData &aObject
)const [private]

Get an object for the current query

Parameters

TUint32 aHandle
CMTPObjectMetaData & aObject

GetObjectSuidsL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, CDesCArray &)

voidGetObjectSuidsL(const TMTPObjectMgrQueryParams &aParams,
RMTPObjectMgrQueryContext &aContext,
CDesCArray &aSuids
)const

Parameters

const TMTPObjectMgrQueryParams & aParams
RMTPObjectMgrQueryContext & aContext
CDesCArray & aSuids

HandleL(const TDesC &)

TUint32 HandleL(const TDesC &aSuid)const

Parameters

const TDesC & aSuid

HandleL(TUint32, const TDesC &)

TUint32 HandleL(TUint32aSuidHash,
const TDesC &aSuid
)const

Parameters

TUint32 aSuidHash
const TDesC & aSuid

IncTranOpsNumL()

voidIncTranOpsNumL()

InitializeDbL()

voidInitializeDbL()[private]

Initialises the database, it creates the table and index if the database does not exist, otherwise, it open the existing table and index

InsertObjectL(CMTPObjectMetaData &)

voidInsertObjectL(CMTPObjectMetaData &aObject)

Parameters

CMTPObjectMetaData & aObject

InsertObjectsL(RPointerArray< CMTPObjectMetaData > &)

voidInsertObjectsL(RPointerArray< CMTPObjectMetaData > &aObjects)

Parameters

RPointerArray< CMTPObjectMetaData > & aObjects

IsInvalidHandle(TUint32)

TBool IsInvalidHandle(TUint32aHandle)const [private]

Parameters

TUint32 aHandle

IsMediaFormat(TUint32)

TBool IsMediaFormat(TUint32aFormatCode)

Determine if the object is of WMP supported media format

Parameters

TUint32 aFormatCode

LocateByHandleL(const TUint, const TBool)

TBool LocateByHandleL(const TUintaHandle,
const TBoolaReadTable = ETrue
)const [private]

Parameters

const TUint aHandle
const TBool aReadTable = ETrue

LocateBySuidL(const TDesC &)

TBool LocateBySuidL(const TDesC &aSuid)const [private]

Parameters

const TDesC & aSuid

MarkDPLoadedL(TUint, TBool)

voidMarkDPLoadedL(TUintaDataProviderId,
TBoolaFlag
)

Parameters

TUint aDataProviderId
TBool aFlag

MarkNonPersistentObjectsL(TUint, TUint32)

voidMarkNonPersistentObjectsL(TUintaDataProviderId,
TUint32aStorageId
)

Parameters

TUint aDataProviderId
TUint32 aStorageId

ModifyObjectL(const CMTPObjectMetaData &)

voidModifyObjectL(const CMTPObjectMetaData &aObject)

Parameters

const CMTPObjectMetaData & aObject

MtpDeltaDataMgr()

CMtpDeltaDataMgr *MtpDeltaDataMgr()const

Provides a reference to the MTP delta Data manager object.

NewL()

CMTPObjectStore *NewL()[static]
MTP object meta data store factory method.
leave
One of the system wide error codes, if a processing failure occurs.

ObjectExistsL(const TUint32)

TBool ObjectExistsL(const TUint32aHandle)

Parameters

const TUint32 aHandle

ObjectL(const TMTPTypeUint32 &, CMTPObjectMetaData &)

TBool ObjectL(const TMTPTypeUint32 &aHandle,
CMTPObjectMetaData &aObject
)const

Parameters

const TMTPTypeUint32 & aHandle
CMTPObjectMetaData & aObject

ObjectL(const TDesC &, CMTPObjectMetaData &)

TBool ObjectL(const TDesC &aSuid,
CMTPObjectMetaData &aObject
)const

Parameters

const TDesC & aSuid
CMTPObjectMetaData & aObject

ObjectOwnerId(const TMTPTypeUint32 &)

TUint ObjectOwnerId(const TMTPTypeUint32 &aHandle)const

Parameters

const TMTPTypeUint32 & aHandle

ObjectSuidL(TUint32)

const TPtrCObjectSuidL(TUint32aHandle)const

Parameters

TUint32 aHandle

ObjectsEnumComplete()

voidObjectsEnumComplete()

OpenDb(const TDesC &)

TInt OpenDb(const TDesC &aFileName)[private]

Open the database with the specified database name

Parameters

const TDesC & aFileNameThe name of the database to open

PkgIDStore()

CMTPPkgIDStore &PkgIDStore()const

PuidL(const TUint32)

TMTPTypeUint128 PuidL(const TUint32aHandle)

Parameters

const TUint32 aHandle

PuidL(const TDesC &)

TMTPTypeUint128 PuidL(const TDesC &aSuid)

Parameters

const TDesC & aSuid

ReferenceMgr()

CMTPReferenceMgr &ReferenceMgr()const

Provides a reference to the reference manager object.

RemoveNonPersistentObjectsL(TUint)

voidRemoveNonPersistentObjectsL(TUintaDataProviderId)

Parameters

TUint aDataProviderId

RemoveObjectL(const TMTPTypeUint32 &)

voidRemoveObjectL(const TMTPTypeUint32 &aHandle)

Parameters

const TMTPTypeUint32 & aHandle

RemoveObjectL(const TDesC &)

voidRemoveObjectL(const TDesC &aSuid)

Parameters

const TDesC & aSuid

RemoveObjectsByStorageIdL(TUint32)

voidRemoveObjectsByStorageIdL(TUint32aStorageId)

Parameters

TUint32 aStorageId

RemoveObjectsL(const CDesCArray &)

voidRemoveObjectsL(const CDesCArray &aSuids)

Parameters

const CDesCArray & aSuids

RemoveObjectsL(TUint)

voidRemoveObjectsL(TUintaDataProviderId)

Parameters

TUint aDataProviderId

RemoveUndefinedObjectsL()

voidRemoveUndefinedObjectsL()

ReserveObjectHandleL(CMTPObjectMetaData &, TUint64)

voidReserveObjectHandleL(CMTPObjectMetaData &aObject,
TUint64aSpaceRequired
)

Parameters

CMTPObjectMetaData & aObject
TUint64 aSpaceRequired

RestorePersistentObjectsL(TUint)

voidRestorePersistentObjectsL(TUintaDataProviderId)

Initialize the handle allocator for this DP with the minimum object ID to use. This must not be called while an initiator has an open session or it could cause an object ID to be reused.

Parameters

TUint aDataProviderIdData provider ID whose handle allocator must be initialized

TraverseL(const TMTPObjectMgrQueryParams &, MTraverseAction &)

voidTraverseL(const TMTPObjectMgrQueryParams &aParams,
MTraverseAction &action
)const

Parameters

const TMTPObjectMgrQueryParams & aParams
MTraverseAction & action

UnreserveObjectHandleL(const CMTPObjectMetaData &)

voidUnreserveObjectHandleL(const CMTPObjectMetaData &aObject)

Parameters

const CMTPObjectMetaData & aObject

Member Enumerations Documentation

Enum TObjectStore

Enumeration representing the column fields in the object store DBMS, this definition must exactly match the sequence defined in KSQLCreateHandleTableText During insert a object, only the following items is provided in the CMTPObjectMetaData DPId Format FormatSubcode StorageID Modes ParentHandle

Handle is allocated by MTP framework NonConsumable is inserted only by FileDP, for objects manged by LicenseeDP, its values is meaningless

Enumerators

EObjectStoreHandleId = 1
EObjectStoreSUIDHash = 2
EObjectStoreSUID = 3
EObjectStoreDataProviderId = 4
EObjectStoreFormatCode = 5
EObjectStoreFormatSubCode = 6
EObjectStoreStorageId = 7
EObjectStoreModes = 8
EObjectStorePOUID = 9
EObjectStoreParentHandle = 10
EObjectStoreDPFlag = 11
EObjectStoreNonConsumable = 12
EObjectStoreName = 13

Member Data Documentation

const TUint KQueryWindowForeSlots

const TUintKQueryWindowForeSlots[private, static]

const TUint KQueryWindowRearSlots

const TUintKQueryWindowRearSlots[private, static]

__FLOG_DECLARATION_MEMBER_MUTABLE

__FLOG_DECLARATION_MEMBER_MUTABLE[private]

FLOGGER debug trace member variable.

RDbTable iBatched

RDbTable iBatched[private]

RDbTable iBatched_SuidHashID

RDbTable iBatched_SuidHashID[private]

TBool iCacheExist

TBool iCacheExist[private]

TUint32 iCachedHandle

TUint32 iCachedHandle[private]

TUint32 iCachedSuidHash

TUint32 iCachedSuidHash[private]

TBool iCleanUndefined

TBool iCleanUndefined[private]

CDbCompactor * iCompactor

CDbCompactor *iCompactor[private]

CMTPDPIDStore * iDPIDStore

CMTPDPIDStore *iDPIDStore[private]

RDbNamedDatabase iDatabase

RDbNamedDatabase iDatabase[private]

RPointerArray< CEnumertingCacheItem > iEnumeratingCacheObjList

RPointerArray< CEnumertingCacheItem >iEnumeratingCacheObjList[private]

CMTPHandleAllocator * iHandleAllocator

CMTPHandleAllocator *iHandleAllocator[private]

TUint32 iMaxCommitLimit

TUint32 iMaxCommitLimit[private]

TUint32 iMaxCompactLimit

TUint32 iMaxCompactLimit[private]

CMtpDeltaDataMgr * iMtpDeltaDataMgr

CMtpDeltaDataMgr *iMtpDeltaDataMgr[private]

RArray< TUint > iNonPersistentDPList

RArray< TUint >iNonPersistentDPList[private]

CMTPPkgIDStore * iPkgIDStore

CMTPPkgIDStore *iPkgIDStore[private]

CMTPReferenceMgr * iReferenceMgr

CMTPReferenceMgr *iReferenceMgr[private]

CEnumertingCacheItem * iSentinal

CEnumertingCacheItem *iSentinal[private]

RMTPFramework iSingletons

RMTPFramework iSingletons[private]

TInt iSnapshotCleanPos

TInt iSnapshotCleanPos[private]

CSnapshotWorker * iSnapshotWorker

CSnapshotWorker *iSnapshotWorker[private]

TBuf< KMTPMaxSqlStatementLen > iSqlStatement

TBuf< KMTPMaxSqlStatementLen >iSqlStatement[private]

TFileName iSuidBuf

TFileName iSuidBuf[private]

TUint32 iTransactionOps

TUint32 iTransactionOps[private]

TBool iUpdateDeltaDataTable

TBool iUpdateDeltaDataTable[private]