predictivesearch/PcsAlgorithm/Algorithm1/src/CPcsCache.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 21 b3431bff8c19
child 39 a6539d1e8e43
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
   118 // Get list of pool elements specific to a pool
   118 // Get list of pool elements specific to a pool
   119 // ----------------------------------------------------------------------------     
   119 // ----------------------------------------------------------------------------     
   120 void CPcsCache::GetContactsForKeyL(TInt aKeyId, RPointerArray<CPcsPoolElement>& aData)
   120 void CPcsCache::GetContactsForKeyL(TInt aKeyId, RPointerArray<CPcsPoolElement>& aData)
   121     {
   121     {
   122     PRINT ( _L("Enter CPcsCache::GetContactsForKeyL") );
   122     PRINT ( _L("Enter CPcsCache::GetContactsForKeyL") );
   123     
   123     CleanupClosePushL( aData );
   124     if ( aKeyId >= 0 && aKeyId < iKeyArr.Count() )
   124     if ( aKeyId >= 0 && aKeyId < iKeyArr.Count() )
   125         {
   125         {
   126         const RPointerArray<CPcsPoolElement>& arr = *iKeyArr[aKeyId];
   126         const RPointerArray<CPcsPoolElement>& arr = *iKeyArr[aKeyId];
   127         for ( TInt i = 0; i < arr.Count(); i++ )
   127         for ( TInt i = 0; i < arr.Count(); i++ )
   128             {
   128             {
   129             aData.AppendL(arr[i]);
   129             aData.AppendL(arr[i]);
   130             }
   130             }
   131         }
   131         }
   132     
   132     CleanupStack::Pop();
   133     PRINT ( _L("End CPcsCache::GetContactsForKeyL") );
   133     PRINT ( _L("End CPcsCache::GetContactsForKeyL") );
   134     }
   134     }
   135 
   135 
   136 // ----------------------------------------------------------------------------
   136 // ----------------------------------------------------------------------------
   137 // CPcsCache::GetAllContentsL
   137 // CPcsCache::GetAllContentsL
   138 // Get all data elements in this cache
   138 // Get all data elements in this cache
   139 // ----------------------------------------------------------------------------     
   139 // ----------------------------------------------------------------------------     
   140 void CPcsCache::GetAllContentsL(RPointerArray<CPsData>& aData)
   140 void CPcsCache::GetAllContentsL(RPointerArray<CPsData>& aData)
   141 {
   141 {
   142     PRINT ( _L("Enter CPcsCache::GetAllContentsL") );
   142     PRINT ( _L("Enter CPcsCache::GetAllContentsL") );
   143         	
   143     CleanupClosePushL( aData );	
   144 	for ( TInt i = 0; i < iMasterPool.Count(); i++ )
   144 	for ( TInt i = 0; i < iMasterPool.Count(); i++ )
   145 	{
   145 	{
   146         aData.AppendL(iMasterPool[i]);
   146         aData.AppendL(iMasterPool[i]);
   147 	}
   147 	}
   148     
   148 	CleanupStack::Pop();
   149 	PRINT ( _L("End CPcsCache::GetAllContentsL") );
   149 	PRINT ( _L("End CPcsCache::GetAllContentsL") );
   150 }
   150 }
   151 
   151 
   152 // ----------------------------------------------------------------------------
   152 // ----------------------------------------------------------------------------
   153 // CPcsCache::AddToPool
   153 // CPcsCache::AddToPool