443 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODREFERENCECOUNT_EXIT ); |
443 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODREFERENCECOUNT_EXIT ); |
444 return referenceCount; |
444 return referenceCount; |
445 } |
445 } |
446 |
446 |
447 // --------------------------------------------------------------------------- |
447 // --------------------------------------------------------------------------- |
|
448 // Returns the destination IDs containing the connection method given as |
|
449 // parameter. |
|
450 // --------------------------------------------------------------------------- |
|
451 // |
|
452 void CCmmInstanceMapping::DestinationsContainingConnMethodL( |
|
453 const TUint32 aConnMethodId, |
|
454 RArray<TUint32>& aDestinationIds ) const |
|
455 { |
|
456 OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONSCONTAININGCONNMETHODL_ENTRY ); |
|
457 |
|
458 aDestinationIds.Reset(); |
|
459 TInt count( 0 ); |
|
460 |
|
461 // Go through each destination. |
|
462 for ( TInt i = 0; i < iDestinations.Count(); i++ ) |
|
463 { |
|
464 TBool foundInThisDestination( EFalse ); |
|
465 |
|
466 // Loop through all connection methods in this destination. |
|
467 count = iDestinations[i]->iConnMethodItemArray.Count(); |
|
468 for ( TInt j = 0; j < count; j++ ) |
|
469 { |
|
470 if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) |
|
471 { |
|
472 foundInThisDestination = ETrue; |
|
473 aDestinationIds.AppendL( iDestinations[i]->iId ); |
|
474 break; |
|
475 } |
|
476 } |
|
477 |
|
478 // Check unsupported connection methods also. |
|
479 if ( !foundInThisDestination ) |
|
480 { |
|
481 count = iDestinations[i]->iUnsupportedConnMethods.Count(); |
|
482 for ( TInt j = 0; j < count; j++ ) |
|
483 { |
|
484 if ( iDestinations[i]->iUnsupportedConnMethods[j] == aConnMethodId ) |
|
485 { |
|
486 aDestinationIds.AppendL( iDestinations[i]->iId ); |
|
487 break; |
|
488 } |
|
489 } |
|
490 } |
|
491 } |
|
492 |
|
493 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONSCONTAININGCONNMETHODL_EXIT ); |
|
494 } |
|
495 |
|
496 // --------------------------------------------------------------------------- |
448 // Get database session. |
497 // Get database session. |
449 // --------------------------------------------------------------------------- |
498 // --------------------------------------------------------------------------- |
450 // |
499 // |
451 CommsDat::CMDBSession& CCmmInstanceMapping::Session() const |
500 CommsDat::CMDBSession& CCmmInstanceMapping::Session() const |
452 { |
501 { |
573 |
622 |
574 if ( !destAlreadyExists ) |
623 if ( !destAlreadyExists ) |
575 { |
624 { |
576 CDestination* dest = CDestination::NewL(); |
625 CDestination* dest = CDestination::NewL(); |
577 dest->iId = destinationId; |
626 dest->iId = destinationId; |
578 iDestinations.Append( dest ); |
627 |
|
628 CCDSNAPMetadataRecord* metadataRecord = new( ELeave ) CCDSNAPMetadataRecord( |
|
629 iCache.TableId( ECmmDestMetadataRecord ) ); |
|
630 CleanupStack::PushL( metadataRecord ); |
|
631 |
|
632 // Add destination metadata. |
|
633 metadataRecord->iSNAP.SetL( destinationId ); |
|
634 if ( metadataRecord->FindL( Session() ) ) |
|
635 { |
|
636 metadataRecord->LoadL( Session() ); |
|
637 dest->iMetadata = metadataRecord->iMetadata; |
|
638 iDestinations.AppendL( dest ); |
|
639 } |
|
640 CleanupStack::PopAndDestroy( metadataRecord ); |
|
641 metadataRecord = NULL; |
579 } |
642 } |
580 } |
643 } |
581 } |
644 } |
582 } |
645 } |
583 |
646 |
1062 // |
1125 // |
1063 void CCmmInstanceMapping::RemoveConnMethod( |
1126 void CCmmInstanceMapping::RemoveConnMethod( |
1064 const TUint32& aConnMethodId, |
1127 const TUint32& aConnMethodId, |
1065 RArray<TUint32>& aChangedDestinations ) |
1128 RArray<TUint32>& aChangedDestinations ) |
1066 { |
1129 { |
|
1130 OstTraceFunctionEntry0( DUP1_CCMMINSTANCEMAPPING_REMOVECONNMETHOD_ENTRY ); |
1067 |
1131 |
1068 // Remove from list of connection methods. |
1132 // Remove from list of connection methods. |
1069 for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) |
1133 for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) |
1070 { |
1134 { |
1071 if ( iConnMethodItemArray[i].iId == aConnMethodId ) |
1135 if ( iConnMethodItemArray[i].iId == aConnMethodId ) |
1087 aChangedDestinations.Append( iDestinations[i]->iId ); |
1151 aChangedDestinations.Append( iDestinations[i]->iId ); |
1088 break; |
1152 break; |
1089 } |
1153 } |
1090 } |
1154 } |
1091 } |
1155 } |
1092 |
1156 |
|
1157 OstTraceFunctionExit0( DUP1_CCMMINSTANCEMAPPING_REMOVECONNMETHOD_EXIT ); |
1093 } |
1158 } |
1094 |
1159 |
1095 // --------------------------------------------------------------------------- |
1160 // --------------------------------------------------------------------------- |
1096 // Remove the destination from current destination/connection method |
1161 // Remove the destination from current destination/connection method |
1097 // structures. This is a lot faster than calling Refresh(). Use this method if |
1162 // structures. This is a lot faster than calling Refresh(). Use this method if |
1157 } |
1222 } |
1158 |
1223 |
1159 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDESTINATIONS_EXIT ); |
1224 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDESTINATIONS_EXIT ); |
1160 } |
1225 } |
1161 |
1226 |
|
1227 // --------------------------------------------------------------------------- |
|
1228 // Iterate through destinations to find the one identified with parameter |
|
1229 // and returns its metadata mask. |
|
1230 // --------------------------------------------------------------------------- |
|
1231 // |
|
1232 TUint32 CCmmInstanceMapping::DestinationMetadata( |
|
1233 const TUint32 aDestinationId ) const |
|
1234 { |
|
1235 OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONMETADATA_ENTRY ); |
|
1236 |
|
1237 TUint32 metadata( 0 ); |
|
1238 for ( TInt i = 0; i < iDestinations.Count(); i++ ) |
|
1239 { |
|
1240 if ( iDestinations[i]->iId == aDestinationId ) |
|
1241 { |
|
1242 metadata = iDestinations[i]->iMetadata; |
|
1243 break; |
|
1244 } |
|
1245 } |
|
1246 |
|
1247 OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONMETADATA_EXIT ); |
|
1248 return metadata; |
|
1249 } |
|
1250 |
1162 // End of file |
1251 // End of file |