CRegistryData Class Reference
class CRegistryData : public CBase |
class CRegistryData. This class manages the entire data of the registry.
Nested Classes and Structures
Public Member Functions |
---|
| ~CRegistryData() |
void | AddDllDataL(const TDriveUnit &, TInt, CDllData *) |
void | DiscoveriesBeginning() |
void | DiscoveriesCompleteL(TBool, TPluginProcessingTypeIdentifier, TBool &) |
TInt
| FindDriveL(const TDriveUnit &, CDriveData *&) |
TInt
| GetImplementationDllInfoForClientL(const TClientRequest &, const TUid, const TUid, TEntry &, CImplementationInformation *&, TBool) |
TInt
| GetImplementationDllInfoForServer(const TCapabilitySet &, const TUid, const TUid, TEntry &, CImplementationInformation *&, TBool &) |
TBool
| HasLanguageChanged() |
TBool
| IndexValid() |
TBool
| InsertIntoIndexL(CImplementationData *, TBool) |
TBool
| IsAnyDllRegisteredWithDriveL(const TDriveUnit &) |
TBool
| IsRegisteredWithDate(TUid, const TTime &, TBool &, CDriveData *) |
void | LanguageChangedL(TBool &) |
void | ListImplementationsL(TUid, RImplDataArray &) |
CRegistryData * | NewL(RFs &) |
CRegistryData * | NewL(RFs &, TInt, TInt) |
void | RemoveFromIndexL(CDllData *) |
void | SetDiscoveryFlagL(const TDriveUnit &) |
TInt
| SetEnabledState(TUid, TBool) |
void | SetImplUpgradeCallBack(const TCallBackWithArg &) |
void | TemporaryUninstallL(const TDriveUnit &) |
void | UndoTemporaryUninstallL(const TDriveUnit &) |
void | UpdateDllDataL(const TDriveUnit &, TInt, CDllData *) |
Private Member Functions |
---|
| CRegistryData(RFs &, TInt, TInt) |
void | AddImplDataL(CDriveData *) |
void | ConstructL() |
void | DeleteDllL(CDllData *) |
void | DriveChanged(const TDriveUnit &, TBool) |
void | FilterForLatestLegitimateImplL(TImplContainerArray &, CImplementationData *, TInsertImplMode &, TInt &, TBool &, TBool) |
TInt
| FindImplementation(const TUid, const TUid, CImplementationData *&) |
TInt
| IndexedFind(TUid) |
void | InsertImplInIndexesL(TInsertImplMode, TInt, TInterfaceIndex &, TInt, CImplementationData *, TBool) |
TInt
| InsertImplIntoImplIndex(CImplementationData *) |
TBool
| MatchOnDrive(const CRegistryData::CDriveData &, const CRegistryData::CDriveData &) |
TBool
| RemoveImplByAddrFromImplIndex(CImplementationData *) |
void | RemoveImplFromImplIndexCleanUp(TAny *) |
void | ResetTInterfaceIndex(TAny *) |
CImplementationData * | SelectDuplicatedImpl(const CImplementationData *, const CImplementationData *) |
CImplementationData * | SelectPreferredImplL(CImplementationData *, CImplementationData *, TBool &, TBool) |
void | ValidateRegistryL() |
Constructor & Destructor Documentation
CRegistryData(RFs &, TInt, TInt)
CRegistryData | ( | RFs & | aFs, |
| TInt | aInterfaceImplIndexGranularity, |
| TInt | aImplIndexGranularity |
| ) | [private, explicit] |
Parameters
RFs & aFs | A handle to a connected file server. |
TInt aInterfaceImplIndexGranularity | |
TInt aImplIndexGranularity | |
~CRegistryData()
~CRegistryData | ( | ) | [virtual] |
Member Functions Documentation
AddDllDataL(const TDriveUnit &, TInt, CDllData *)
Adds data on a specific dll to the registry. The data to be added is parsed by CRegistryParser.
- leave
- KErrNoMemory If the item could not be appended to the registry
- leave
- KEComErrDriveNotFound If aDrive is not a valid drive
- Pre-condition
- This object is fully constructed and there is also a valid drive entry in the registry for aDrive
- Post-condition
- The new data is added to the registry
Parameters
const TDriveUnit & aDrive | The drive the registry data has been found on |
TInt aFoundDriveIndex | The index of the registry data for the drive the interface implementation collection data has been found on. |
CDllData * aDllData | The dll data to add. CRegistryData takes ownership of this object so it should not be on the CleanupStack. |
AddImplDataL(CDriveData *)
This method inserts implementations into the index
- Pre-condition
- This object is fully constructed.
- Post-condition
- all implemementations found, have been inserted into the index.
Parameters
CDriveData * aDriveData | Drive data in which we are searching the implementations |
ConstructL()
void | ConstructL | ( | ) | [private] |
Completes the safe construction of the
CRegistryData object.
- leave
- KErrNoMemory.
- Pre-condition
- This object is constructed
- Post-condition
- This object is fully initialized
DeleteDllL(CDllData *)
void | DeleteDllL | ( | CDllData * | aDllData | ) | const [private] |
This method removes all implementations of This
Dll from the iInterfaceImplIndex, then delete this
Dll from its parent
Dll list.
- Pre-condition
- CRegistrar is fully constructed
Parameters
CDllData * aDllData | the Dll to be cleaned. |
DiscoveriesBeginning()
void | DiscoveriesBeginning | ( | ) | const |
The cue that newly discovered Dlls are about to be registered, and, therefore, the registry index will be out of date until DiscoveriesCompleteL is called.
- Pre-condition
- CRegistrar is fully constructed
- Post-condition
- iCurrentlyDiscovering is set and the index list is cleared.
DiscoveriesCompleteL(TBool, TPluginProcessingTypeIdentifier, TBool &)
The cue to rebuild the registry indexes
- leave
- KErrNoMemory
CStore
- Pre-condition
- CRegistrar is fully constructed
- Post-condition
- The internal access indexes have been rebuilt
Parameters
TBool aSuccessful | Indicates whether discovery completed fully or not |
TPluginProcessingTypeIdentifier aProcessingType | indicates the type of processing for plugins for ensuring that plugins are not processed multiple times during start-up phase |
TBool & aHasRegistryChanged | The flag to indicate whether registry data has been changed |
DriveChanged(const TDriveUnit &, TBool)
Store change in drive state - addition or removal
Update the staus of drives in the system
- Pre-condition
- CRegistry is fully constructed.
- Post-condition
- The state of the drive has been stored
Parameters
const TDriveUnit & aDrive | The drive that has changed |
TBool aDriveRemoved | Indicates whether a drive has been removed or added |
FilterForLatestLegitimateImplL(TImplContainerArray &, CImplementationData *, TInsertImplMode &, TInt &, TBool &, TBool)
This functions checks if a given implementation already exists in the indexes. If it does exist, determine if the given implementation should replace the existing one or not.
- Pre-condition
- This object is fully constructed.
- Post-condition
- none
Parameters
TImplContainerArray & aIdxArray | The container array of the interface to hold the implementation. |
CImplementationData * aNewImpl | The implementation to filter. |
TInsertImplMode & aInsertMode | whether aNewIMpl is a newcomer of the interface, or an update of an existing implementation, or a older version of an existing implementation. |
TInt & aPosOfImplInArray | return the index of aNewImpl in aIdxArray, |
TBool & aLigitimateImpl | Flag,indicating whether current implementation is secure |
TBool aCheckIsNeeded | |
FindDriveL(const TDriveUnit &, CDriveData *&)
FindImplementation(const TUid, const TUid, CImplementationData *&)
Parameters
const TUid aImplUid | The uid of the impl to find |
const TUid aInterfaceUid | The uid of the interface associated with the impl to find or less than 0 if uid is unknown |
CImplementationData *& aImplData | Set to the instance CImplementationData found in the index or if not found set to NULL. This argument is always overwritten. |
GetImplementationDllInfoForClientL(const TClientRequest &, const TUid, const TUid, TEntry &, CImplementationInformation *&, TBool)
Parameters
const TClientRequest & aClientRequest | A client request |
const TUid aImplUid | The Uid of the implementation for which info is required |
const TUid aInterfaceUid | The uid of the interface associated with aImplUid to find or less than 0 if uid is unknown. |
TEntry & aEntry | Output parameter which will contain the dll information |
CImplementationInformation *& aImplInfo | An output parameter. If the call succeeds it will point to the found implementation information, NULL otherwise. |
TBool aSecurityCheckNeeded | The bool value to identify whether the security check is needed here. The default value is false. |
GetImplementationDllInfoForServer(const TCapabilitySet &, const TUid, const TUid, TEntry &, CImplementationInformation *&, TBool &)
Parameters
const TCapabilitySet & aCapabilitySet | A capability set |
const TUid aImplUid | The Uid of the implementation for which info is required |
const TUid aInterfaceUid | The uid of the interface associated with aImplUid to find or less than 0 if uid is unknown. |
TEntry & aEntry | Output parameter which will contain the dll information |
CImplementationInformation *& aImplInfo | An output parameter. If the call succeeds it will point to the found implementation information, NULL otherwise. |
TBool & aIsOnRWDrive | an output parameter. If the call is successful, this will be set to ETrue if the implementation is on RW drive. EFalse if the implementation is on ReadOnly drive. |
HasLanguageChanged()
TBool
| HasLanguageChanged | ( | ) | const |
Indicates whether the language downgrade path has changed. This means we need to call NearestLanguageFile again
- Pre-condition
- CRegistrar is fully constructed
IndexValid()
Indicates whether the registry index is currently valid. The index will not be valid if discoveries are currently taking place. If the index is not currently valid then calls to
ListImplementationsL() cannot be serviced.
- Pre-condition
- CRegistrar is fully constructed
IndexedFind(TUid)
TInt
| IndexedFind | ( | TUid | aInterfaceUid | ) | const [private] |
To find the index entry for aImplementationUid.
- Pre-condition
- This object is fully constructed
InsertImplInIndexesL(TInsertImplMode, TInt, TInterfaceIndex &, TInt, CImplementationData *, TBool)
Handle inserting a CImplementationData in iInterfaceImplIndex and iImplIndex.
-
leave
- KErrNoMemory operation fails because the system is out of memory.
-
leave
- KErrGeneral any non-specific programming error.
-
leave
- KErrAlreadyExists the indexes already have an entry with the same Impl. UID and Interface UID.
Parameters
TInsertImplMode aInsertMode | indicates whether the implementation is a newcover of the interface, or is an update of existing implementation or is an older version of an existing implementation. |
TInt aIfPosInInterfaceImplIndex | is the index of the interface in iInterfaceImplIndex. |
TInterfaceIndex & aNewIfIndexEl | the TInterfaceIndex object containing the implementation. |
TInt aImplPosInContainerArray | is the index of the implementation in the iImpData member of aNewIfIndexEl. |
CImplementationData * aNewImpl | the implementation to add to the indexes. |
TBool aLegitimateImpl | indicate if the implementation passed security check or not. |
InsertImplIntoImplIndex(CImplementationData *)
Insert aNewImpl into iImplIndex.
This method inserts the entry aNewImpl into iImplIndex.
- Pre-condition
- aNewImpl is fully constructed.
InsertIntoIndexL(CImplementationData *, TBool)
This method retrieves the data for security checks from the iInterfaceImplIndex
- Pre-condition
- This object is fully constructed.
- Post-condition
- aImplPtr has been checked and added to the index, or not, depending on the outcome of the checks.
Parameters
CImplementationData * aImplPtr | The new item to be checked |
TBool aCheckIsNeeded | Boolean indicating, whether a filename check is needed |
IsAnyDllRegisteredWithDriveL(const TDriveUnit &)
Find if any
Dll is regsitered in the drive unit.
- Pre-condition
- CRegistry is fully constructed.
- Post-condition
- If any Dll is registered in the drive is returned if successfully.
Parameters
const TDriveUnit & aDrive | The identifier of the drive to find if any Dll is registered. |
IsRegisteredWithDate(TUid, const TTime &, TBool &, CDriveData *)
Determine if the specified implementation grouping already registered, but needs an update.
- Pre-condition
- This object is fully constructed and there is also a valid drive entry in the registry for aDrive
- Post-condition
- The new data is added to the registry
Parameters
TUid aDllUid | The interface implementation collection data to add. CRegistryData takes ownership of this object so it should not be on the CleanupStack. |
const TTime & aModified | The date of the last modification of the Interface Implementation Collection. |
TBool & aUpdate | An output to indicate if the registry entry requires an update. (Only valid if the return is ETrue). |
CDriveData * aDriveData | The drive data used to find DLL. |
LanguageChangedL(TBool &)
void | LanguageChangedL | ( | TBool & | aLanguageChanged | ) | |
This method checks whether the language downgrade path has been changed. If it is, save language downgrade path information and set related flag true.
Parameters
TBool & aLanguageChanged | the returned value to indicate language changed. |
ListImplementationsL(TUid, RImplDataArray &)
Lists the implementations given the interface UID. The filtered list is returned in the client provided RImplDataArray parameter.
Parameters
TUid aInterfaceUid | The Uid of the interface which the implementations should provide |
RImplDataArray & aImplementationData | Return value. The filtered list. |
MatchOnDrive(const CRegistryData::CDriveData &, const CRegistryData::CDriveData &)
NewL(RFs &)
Standardized safe construction which leaves nothing on the cleanup stack. This overload uses default granularities for the two indexes. These default values were found to provide reasonably good performance at the time of testing.
- leave
- KErrNoMemory.
- Post-condition
- CRegistryData is fully constructed, and initialized.
Parameters
RFs & aFs | The open file session. |
NewL(RFs &, TInt, TInt)
This overload is provided for ECom performance test to find the optimum granularity settings. CEComImplIndexPerfTestStandardized safe construction which leaves nothing on the cleanup stack. This overload is used by CEComImplIndexPerfTest which plots discovery time vs. granularity settings.
- leave
- KErrNoMemory.
- Post-condition
- CRegistryData is fully constructed, and initialized.
Parameters
RFs & aFs | The open file session. |
TInt aInterfaceImplIndexGranularity | granularity of main index. |
TInt aImplIndexGranularity | granularity of auxiliary index. |
RemoveFromIndexL(CDllData *)
void | RemoveFromIndexL | ( | CDllData * | aDllData | ) | const |
This method takes removes all implementations of a plugin from the iInterfaceImplIndex
- Pre-condition
- This object is constructed
- Post-condition
- All implementations of the CDllData object, have been removed from the index
Parameters
CDllData * aDllData | Reference to a fully constructed CDllData object |
RemoveImplByAddrFromImplIndex(CImplementationData *)
Remove the pointer from iImplIndex based on the impl address
This method does a search by address and removes the specified entry from iImplIndex.
RemoveImplFromImplIndexCleanUp(TAny *)
void | RemoveImplFromImplIndexCleanUp | ( | TAny * | aPtr | ) | [private, static] |
Used to restore the impIndex sanity in case of a leave
ResetTInterfaceIndex(TAny *)
void | ResetTInterfaceIndex | ( | TAny * | aObject | ) | [private, static] |
SelectDuplicatedImpl(const CImplementationData *, const CImplementationData *)
This function helps FindImplementation() to decide which of two implementations with duplicated implementation UID to choose. The selection rules are: 1. ROM based plugins > non-ROM based. 2. Higher drive letter > lower drive letter 3. Lower I/F UID > Higher I/F UID (for backward compatibility reason)
SelectPreferredImplL(CImplementationData *, CImplementationData *, TBool &, TBool)
Determines whether the new implmentation should be preferred over the existing implementation. Validates later version implementations from R/W drives.
- Pre-condition
- This object is fully constructed.
SetDiscoveryFlagL(const TDriveUnit &)
void | SetDiscoveryFlagL | ( | const TDriveUnit & | aDriveUnit | ) | |
SetEnabledState(TUid, TBool)
Enables or disables the specified interface implementation within the registry.
- Pre-condition
- CRegistry is fully constructed,
- Post-condition
- The implementation is now enabled or disabled as described by aState.
Parameters
TUid aImplementationUid | The interface implementation to change. |
TBool aState | ETrue to enable the implementation, EFalse to disable it |
SetImplUpgradeCallBack(const TCallBackWithArg &)
setter If need to unset the callback, use a TCallBackWithArg constructed with no arguments.
TemporaryUninstallL(const TDriveUnit &)
Temporarily uninstalls the interface implementation groups upon the specified drive. (ie this can be undone later).
- Pre-condition
- CRegistry is fully constructed
- Post-condition
- The registered implementation groupings stored upon the specified drive are no longer available for use.
Parameters
const TDriveUnit & aDrive | The identifier of the drive to uninstall. |
UndoTemporaryUninstallL(const TDriveUnit &)
void | UndoTemporaryUninstallL | ( | const TDriveUnit & | aDrive | ) | |
Undoes a temporary uninstall of the interface implementation groups upon the specified drive. (ie this can be undone later).
- leave
- KErrNoMemory, KErrReinstallFailed.
- Pre-condition
- CRegistry is fully constructed
- Post-condition
- The registered implementation groupings stored upon the specified drive are again made available for use.
Parameters
const TDriveUnit & aDrive | The identifier of the drive to reinstate. |
UpdateDllDataL(const TDriveUnit &, TInt, CDllData *)
Updates the data for a dll in the registry.
- leave
- KErrNoMemory If the indexes cannot be rebuilt
- Pre-condition
- This object is fully constructed
- Post-condition
- The dll data is updated in the registry
Parameters
const TDriveUnit & aDrive | |
TInt aFoundDriveIndex | The index of the registry data for the drive the interface implementation collection data has been found on. |
CDllData * aDllData | The updated interface implementation collection data. CRegistryData takes ownership of this object so it should not be on the CleanupStack. |
ValidateRegistryL()
void | ValidateRegistryL | ( | ) | [private] |
Checks each entry in the registry to ensure that both the RSC file and the corresponding dll exist. If not the dll branch is removed from the tree. If a drive branch is found which contains no dlls it is also removed.
- Pre-condition
- This object is fully constructed.
- Post-condition
- Any out of date registry entries are removed from the tree.
Member Enumerations Documentation
Enum TInsertImplMode
whether the implementation to be added to the registry data is a newcomer, or upgrade of an existing implementation, or downgrade of an existing implementation.
Enumerators
EInsertImplUndefinedMode | |
EInsertImplAsNewcomerOfInterface | |
EInsertImplAsUpgradeOfExistingImpl | |
EInsertImplAsUnusedImpl | |
Member Type Definitions Documentation
Typedef CImplementationDataPtr
Typedef TImplContainer
Implementation structure containing the current in use implementation and a list of unused implementations with the same uid held in the registry tree. The unused list is used to allow efficient rollback to previous impl in the event that the current impl is removed.
Typedef TImplContainerArray
Typedef TInterfaceIndex
Interface used by all implementation index
Member Data Documentation
CEComCachedDriveInfo * iCachedDriveInfo
TBool
iCurrentlyDiscovering
TBool
| iCurrentlyDiscovering | [private] |
The flag to indicate that we are in the middle of discoveries and therefore the index list is probably out of date
RFs & iFs
A reference to a connected file server instance
RPointerArray< CImplementationData > iImplIndex
Index of all implementations available to clients sorted by Implementation UID. Majority of clients do not specify the interface UID in their create requests. Thus ECOM needs this auxiliary index. Note that if multiple entries have the same Impl. UID, they are ordered by the interface UID.
TCallBackWithArg
iImplUpgradeCallBack
RArray< TInterfaceIndex > iInterfaceImplIndex
The index of all registered implementations sorted by interface UID.
TBool
iLanguageChanged
TBool
| iLanguageChanged | [private] |
A boolean, indicating if the language downgrade path has changed
TRegistration * iRegistrations
The entire registration data
TInt
iRemovedDrives
TInt
| iRemovedDrives | [private] |
Bitmap indicating any drives removed
TDriveNumber
iSystemDrive
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.