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.
Nested Classes and Structures
Public Member Functions
|
|
~CMTPObjectStore
()
|
void
|
BeginTransactionL
()
|
void
|
CalcFreeHandlesL
(
TUint
)
|
void
|
CleanDBSnapshotL
(
TBool
)
|
void
|
CleanL
()
|
void
|
CommitReservedObjectHandleL
(
CMTPObjectMetaData
&)
|
void
|
CommitTransactionL
()
|
TUint
|
CountL
(const
TMTPObjectMgrQueryParams
&)
|
CMTPDPIDStore
&
|
DPIDStore
()
|
RDbDatabase
&
|
Database
()
|
void
|
EstablishDBSnapshotL
(
TUint32
)
|
void
|
GetObjectHandlesL
(const
TMTPObjectMgrQueryParams
&,
RMTPObjectMgrQueryContext
&,
RArray
<
TUint
> &)
|
void
|
GetObjectSuidsL
(const
TMTPObjectMgrQueryParams
&,
RMTPObjectMgrQueryContext
&,
CDesCArray
&)
|
TUint32
|
HandleL
(const
TDesC
&)
|
TUint32
|
HandleL
(
TUint32
, const
TDesC
&)
|
void
|
IncTranOpsNumL
()
|
void
|
InsertObjectL
(
CMTPObjectMetaData
&)
|
void
|
InsertObjectsL
(
RPointerArray
<
CMTPObjectMetaData
> &)
|
TBool
|
IsMediaFormat
(
TUint32
)
|
void
|
MarkDPLoadedL
(
TUint
,
TBool
)
|
void
|
MarkNonPersistentObjectsL
(
TUint
,
TUint32
)
|
void
|
ModifyObjectL
(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
TPtrC
|
ObjectSuidL
(
TUint32
)
|
void
|
ObjectsEnumComplete
()
|
CMTPPkgIDStore
&
|
PkgIDStore
()
|
TMTPTypeUint128
|
PuidL
(const
TUint32
)
|
TMTPTypeUint128
|
PuidL
(const
TDesC
&)
|
CMTPReferenceMgr
&
|
ReferenceMgr
()
|
void
|
RemoveNonPersistentObjectsL
(
TUint
)
|
void
|
RemoveObjectL
(const
TMTPTypeUint32
&)
|
void
|
RemoveObjectL
(const
TDesC
&)
|
void
|
RemoveObjectsByStorageIdL
(
TUint32
)
|
void
|
RemoveObjectsL
(const
CDesCArray
&)
|
void
|
RemoveObjectsL
(
TUint
)
|
void
|
RemoveUndefinedObjectsL
()
|
void
|
ReserveObjectHandleL
(
CMTPObjectMetaData
&,
TUint64
)
|
void
|
RestorePersistentObjectsL
(
TUint
)
|
void
|
TraverseL
(const
TMTPObjectMgrQueryParams
&,
MTraverseAction
&)
|
void
|
UnreserveObjectHandleL
(const
CMTPObjectMetaData
&)
|
Private Member Functions
|
|
CMTPObjectStore
()
|
void
|
BuildObjectMetaDataL
(
CMTPObjectMetaData
&, const
RDbTable
&)
|
void
|
CloseDb
()
|
void
|
ConstructL
()
|
void
|
CreateDbL
(const
TDesC
&)
|
void
|
CreateHandleIndexL
()
|
void
|
CreateHandleTableL
()
|
void
|
CreateStorageIndexL
()
|
void
|
CreateStorageTableL
()
|
void
|
DBUpdateFailRecover
(
TAny
*)
|
void
|
DbColReadStreamL
(const
RDbTable
&,
TDbColNo
,
TDes16
&)
|
void
|
DbColWriteStreamL
(
RDbTable
&,
TDbColNo
, const
TDesC16
&)
|
TBool
|
FilterObject
(const
RDbTable
&, const
TUint32
, const
TUint32
, const
TUint32
)
|
void
|
GetFullPathName
(const
TDesC
&,
TFileName
&)
|
TBool
|
GetObjectL
(
TUint32
,
CMTPObjectMetaData
&)
|
void
|
InitializeDbL
()
|
TBool
|
IsInvalidHandle
(
TUint32
)
|
TBool
|
LocateByHandleL
(const
TUint
, const
TBool
)
|
TBool
|
LocateBySuidL
(const
TDesC
&)
|
TInt
|
OpenDb
(const
TDesC
&)
|
Private Member Enumerations
|
enum
|
TObjectStore
{
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
}
|
Constructor & Destructor Documentation
CMTPObjectStore()
CMTPObjectStore
|
(
|
)
|
[private]
|
Member Functions Documentation
BeginTransactionL()
void
|
BeginTransactionL
|
(
|
)
|
|
BuildObjectMetaDataL(CMTPObjectMetaData &, const RDbTable &)
CalcFreeHandlesL(TUint)
void
|
CalcFreeHandlesL
|
(
|
TUint
|
aDataProviderId
|
)
|
|
CleanDBSnapshotL(TBool)
void
|
CleanDBSnapshotL
|
(
|
TBool
|
aOnlyRoot = EFalse
|
)
|
|
CleanL()
Clean unloaded data provider contents from object store
CloseDb()
void
|
CloseDb
|
(
|
)
|
[private]
|
Close the current opened database
CommitReservedObjectHandleL(CMTPObjectMetaData &)
CommitTransactionL()
void
|
CommitTransactionL
|
(
|
)
|
|
ConstructL()
void
|
ConstructL
|
(
|
)
|
[private]
|
Second phase constructor.
CountL(const TMTPObjectMgrQueryParams &)
CreateDbL(const TDesC &)
void
|
CreateDbL
|
(
|
const
TDesC
&
|
aFileName
|
)
|
[private]
|
Create the database with the specified database name
Parameters
const
TDesC
& aFileName
|
The name of the database to create
|
CreateHandleIndexL()
void
|
CreateHandleIndexL
|
(
|
)
|
[private]
|
Create three index on the table: 1. Handle, 2. SuidHash, 3. ParentHandle
CreateHandleTableL()
void
|
CreateHandleTableL
|
(
|
)
|
[private]
|
Create the table for storing the mapping from object handle to other properties (data provider id, storage id, formatcode, etc.)
CreateStorageIndexL()
void
|
CreateStorageIndexL
|
(
|
)
|
[private]
|
CreateStorageTableL()
void
|
CreateStorageTableL
|
(
|
)
|
[private]
|
DBUpdateFailRecover(TAny *)
void
|
DBUpdateFailRecover
|
(
|
TAny
*
|
aTable
|
)
|
[private, static]
|
DPIDStore()
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 &)
DbColWriteStreamL(RDbTable &, TDbColNo, const TDesC16 &)
EstablishDBSnapshotL(TUint32)
void
|
EstablishDBSnapshotL
|
(
|
TUint32
|
aStorageId
|
)
|
|
FilterObject(const RDbTable &, const TUint32, const TUint32, const TUint32)
GetFullPathName(const TDesC &, TFileName &)
void
|
GetFullPathName
|
(
|
const
TDesC
&
|
aName,
|
|
TFileName
&
|
aFileName
|
|
)
|
const [private]
|
Get the full path of the database
Parameters
const
TDesC
& aName
|
|
TFileName
& aFileName
|
The file name of the database to be retrieved
|
GetObjectHandlesL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, RArray< TUint > &)
GetObjectL(TUint32, CMTPObjectMetaData &)
Get an object for the current query
GetObjectSuidsL(const TMTPObjectMgrQueryParams &, RMTPObjectMgrQueryContext &, CDesCArray &)
HandleL(TUint32, const TDesC &)
InitializeDbL()
void
|
InitializeDbL
|
(
|
)
|
[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 &)
InsertObjectsL(RPointerArray< CMTPObjectMetaData > &)
IsMediaFormat(TUint32)
Determine if the object is of WMP supported media format
LocateByHandleL(const TUint, const TBool)
TBool
|
LocateByHandleL
|
(
|
const
TUint
|
aHandle,
|
|
const
TBool
|
aReadTable = ETrue
|
|
)
|
const [private]
|
Parameters
const
TUint
aHandle
|
|
const
TBool
aReadTable = ETrue
|
|
LocateBySuidL(const TDesC &)
TBool
|
LocateBySuidL
|
(
|
const
TDesC
&
|
aSuid
|
)
|
const [private]
|
MarkDPLoadedL(TUint, TBool)
void
|
MarkDPLoadedL
|
(
|
TUint
|
aDataProviderId,
|
|
TBool
|
aFlag
|
|
)
|
|
MarkNonPersistentObjectsL(TUint, TUint32)
void
|
MarkNonPersistentObjectsL
|
(
|
TUint
|
aDataProviderId,
|
|
TUint32
|
aStorageId
|
|
)
|
|
ModifyObjectL(const CMTPObjectMetaData &)
MtpDeltaDataMgr()
Provides a reference to the MTP delta Data manager object.
NewL()
MTP object meta data store factory method.
-
leave
-
One of the system wide error codes, if a processing failure occurs.
ObjectExistsL(const TUint32)
ObjectL(const TMTPTypeUint32 &, CMTPObjectMetaData &)
ObjectL(const TDesC &, CMTPObjectMetaData &)
ObjectOwnerId(const TMTPTypeUint32 &)
ObjectsEnumComplete()
void
|
ObjectsEnumComplete
|
(
|
)
|
|
OpenDb(const TDesC &)
TInt
|
OpenDb
|
(
|
const
TDesC
&
|
aFileName
|
)
|
[private]
|
Open the database with the specified database name
Parameters
const
TDesC
& aFileName
|
The name of the database to open
|
ReferenceMgr()
Provides a reference to the reference manager object.
RemoveNonPersistentObjectsL(TUint)
void
|
RemoveNonPersistentObjectsL
|
(
|
TUint
|
aDataProviderId
|
)
|
|
RemoveObjectL(const TMTPTypeUint32 &)
RemoveObjectL(const TDesC &)
void
|
RemoveObjectL
|
(
|
const
TDesC
&
|
aSuid
|
)
|
|
RemoveObjectsByStorageIdL(TUint32)
void
|
RemoveObjectsByStorageIdL
|
(
|
TUint32
|
aStorageId
|
)
|
|
RemoveObjectsL(const CDesCArray &)
RemoveObjectsL(TUint)
void
|
RemoveObjectsL
|
(
|
TUint
|
aDataProviderId
|
)
|
|
RemoveUndefinedObjectsL()
void
|
RemoveUndefinedObjectsL
|
(
|
)
|
|
ReserveObjectHandleL(CMTPObjectMetaData &, TUint64)
RestorePersistentObjectsL(TUint)
void
|
RestorePersistentObjectsL
|
(
|
TUint
|
aDataProviderId
|
)
|
|
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
aDataProviderId
|
Data provider ID whose handle allocator must be initialized
|
TraverseL(const TMTPObjectMgrQueryParams &, MTraverseAction &)
UnreserveObjectHandleL(const CMTPObjectMetaData &)
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
TUint
|
KQueryWindowForeSlots
|
[private, static]
|
const TUint KQueryWindowRearSlots
const
TUint
|
KQueryWindowRearSlots
|
[private, static]
|
__FLOG_DECLARATION_MEMBER_MUTABLE
|
__FLOG_DECLARATION_MEMBER_MUTABLE
|
[private]
|
FLOGGER debug trace member variable.
RDbTable
iBatched_SuidHashID
TBool
iCacheExist
TBool
|
iCacheExist
|
[private]
|
TBool
iCleanUndefined
TBool
|
iCleanUndefined
|
[private]
|
CDbCompactor * iCompactor
CMTPDPIDStore * iDPIDStore
RDbNamedDatabase
iDatabase
RPointerArray< CEnumertingCacheItem > iEnumeratingCacheObjList
CMTPHandleAllocator * iHandleAllocator
CMtpDeltaDataMgr * iMtpDeltaDataMgr
RArray< TUint > iNonPersistentDPList
CMTPPkgIDStore * iPkgIDStore
CMTPReferenceMgr * iReferenceMgr
CEnumertingCacheItem * iSentinal
RMTPFramework
iSingletons
TInt
iSnapshotCleanPos
TInt
|
iSnapshotCleanPos
|
[private]
|
CSnapshotWorker * iSnapshotWorker
TBuf< KMTPMaxSqlStatementLen > iSqlStatement
TBool
iUpdateDeltaDataTable
TBool
|
iUpdateDeltaDataTable
|
[private]
|
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.