predictivesearch/PcsAlgorithm/Algorithm2/src/CPcsCache.cpp
branchRCL_3
changeset 68 9da50d567e3c
parent 63 f4a778e096c2
child 85 38bb213f60ba
equal deleted inserted replaced
63:f4a778e096c2 68:9da50d567e3c
    20 *
    20 *
    21 */
    21 */
    22 
    22 
    23 // INCLUDE FILES
    23 // INCLUDE FILES
    24 #include <MVPbkContactLink.h>
    24 #include <MVPbkContactLink.h>
    25 #include <VPbkEng.rsg>
    25 #include <vpbkeng.rsg>
    26 
    26 
    27 #include "FindUtilChineseECE.h"
    27 #include "FindUtilChineseECE.h"
    28 #include "CPsData.h"
    28 #include "CPsData.h"
    29 #include "CPcsCache.h"
    29 #include "CPcsCache.h"
    30 #include "CPcsDebug.h"
    30 #include "CPcsDebug.h"
   166     // Second TInt = Location in the pool
   166     // Second TInt = Location in the pool
   167     // Required for memory optimization so that more than one pool
   167     // Required for memory optimization so that more than one pool
   168     // element doesn't get added for the same data
   168     // element doesn't get added for the same data
   169     RHashMap<TInt, TInt> elementHash;
   169     RHashMap<TInt, TInt> elementHash;
   170     CleanupClosePushL( elementHash );
   170     CleanupClosePushL( elementHash );
   171     TLinearOrder<CPcsPoolElement> rule(CPcsPoolElement::CompareByData);
   171     TLinearOrder<CPcsPoolElement> rule(CPcsPoolElement::CompareByDataL);
   172 
   172 
   173     // Parse thru each data element
   173     // Parse thru each data element
   174     const TInt dataElementCount = aData.DataElementCount();
   174     const TInt dataElementCount = aData.DataElementCount();
   175     for (TInt dataIndex = 0; dataIndex < dataElementCount; dataIndex++)
   175     for (TInt dataIndex = 0; dataIndex < dataElementCount; dataIndex++)
   176         {
   176         {
   257     TUint64 poolMap = 0;
   257     TUint64 poolMap = 0;
   258     AddToPoolL(poolMap, aData);
   258     AddToPoolL(poolMap, aData);
   259     iCacheInfo.InsertL(aData.Id(), poolMap);
   259     iCacheInfo.InsertL(aData.Id(), poolMap);
   260 
   260 
   261     // Include this element in master pool        
   261     // Include this element in master pool        
   262     TLinearOrder<CPsData> rule(CPcsAlgorithm2Utils::CompareDataBySortOrder);
   262     TLinearOrder<CPsData> rule(CPcsAlgorithm2Utils::CompareDataBySortOrderL);
   263     iMasterPool.InsertInOrderAllowRepeatsL(&aData, rule);
   263     iMasterPool.InsertInOrderAllowRepeatsL(&aData, rule);
   264     }
   264     }
   265 
   265 
   266 // ---------------------------------------------------------------------
   266 // ---------------------------------------------------------------------
   267 // CPcsCache::RemoveContactL
   267 // CPcsCache::RemoveContactL