datacommsserver/esockserver/ssock/ss_tiermanagerutils.cpp
branchRCL_3
changeset 14 4ccf8e394726
parent 0 dfb7c4ff071f
equal deleted inserted replaced
13:0b0e9fce0b58 14:4ccf8e394726
   736 	}
   736 	}
   737 
   737 
   738 EXPORT_C TUid TierManagerUtils::MapTierIdtoTierImplIdL(TUid aTierUid,CommsDat::CMDBSession& aDbs )
   738 EXPORT_C TUid TierManagerUtils::MapTierIdtoTierImplIdL(TUid aTierUid,CommsDat::CMDBSession& aDbs )
   739 /** mapping TM Id to TM ImplId in Commsdat */
   739 /** mapping TM Id to TM ImplId in Commsdat */
   740 	{
   740 	{
   741 	TUid ImplUid;
   741     TUid ImplUid;
   742 	// if it does not exist, it returns tier id
   742     // if it does not exist, it returns tier id
   743 	ImplUid = aTierUid;
   743     ImplUid = aTierUid;
   744 
   744 
   745 	CMDBRecordSet<CCDTierRecord>* recSet = new (ELeave) CMDBRecordSet<CCDTierRecord>(KCDTIdTierRecord);
   745     CCDTierRecord* tierRec = static_cast<CCDTierRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdTierRecord));
   746 	CleanupStack::PushL(recSet);
   746     CleanupStack::PushL(tierRec);
   747 	recSet->LoadL(aDbs);
   747     tierRec->iRecordTag = aTierUid.iUid;
   748 	const TInt recCnt = recSet->iRecords.Count();
   748 
   749 	
   749     TBool found = tierRec->FindL(aDbs);
   750 	for(TInt i = 0; i < recCnt; i++)
   750 
   751 		{
   751     if (found)
   752 		CCDTierRecord* rec = static_cast<CCDTierRecord*>(recSet->iRecords[i]);
   752         {
   753 		if(rec->iRecordTag == aTierUid.iUid)
   753         ImplUid.iUid = tierRec->iTierImplUid;
   754 			{
   754         }
   755 			ImplUid.iUid = rec->iTierImplUid;
   755 
   756 			}
   756     CleanupStack::PopAndDestroy(tierRec);   
   757 		}
   757     return ImplUid;
   758 	
   758 
   759 	CleanupStack::PopAndDestroy(recSet);	
   759     }
   760 	return ImplUid;
       
   761 	}
       
   762 //
   760 //
   763 // CCommsDatIapView
   761 // CCommsDatIapView
   764 //
   762 //
   765 // Class used to retrieve CommsDat values based on a view specific to an IAP.
   763 // Class used to retrieve CommsDat values based on a view specific to an IAP.
   766 //
   764 //