predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsPoolElement.h
changeset 0 e686773b3f54
child 6 e8e3147d53eb
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Identifies a pool element
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPCS_POOL_ELEMENT_ALGORITHM_2_H__
       
    19 #define __CPCS_POOL_ELEMENT_ALGORITHM_2_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <e32math.h>
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CPsData;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CPcsPoolElement : public CBase
       
    30     {
       
    31 
       
    32 public:
       
    33 
       
    34     /**
       
    35      * Two phase construction
       
    36      */
       
    37     static CPcsPoolElement* NewL(CPsData& aPsData);
       
    38 
       
    39     /**
       
    40      * Destructor
       
    41      */
       
    42     virtual ~CPcsPoolElement();
       
    43 
       
    44     /**
       
    45      * Clears the data match element attribute
       
    46      */
       
    47     void ClearDataMatchAttribute();
       
    48 
       
    49     /**
       
    50      * Checks if data matched
       
    51      */
       
    52     TBool IsDataMatch(TInt aIndex);
       
    53 
       
    54     /**
       
    55      * Set data match
       
    56      */
       
    57     void SetDataMatch(TInt aIndex);
       
    58 
       
    59     /**
       
    60      * Return the CPsData object of this pool element
       
    61      */
       
    62     CPsData* GetPsData();
       
    63     /**
       
    64      * Compares the two Pool Elements and returms the comparison value.
       
    65      * It takes care of language variance too.
       
    66      */
       
    67     static TInt CompareByData(const CPcsPoolElement& aObject1,
       
    68                               const CPcsPoolElement& aObject2);
       
    69 
       
    70 private:
       
    71 
       
    72     /*
       
    73      * Constructor
       
    74      */
       
    75     CPcsPoolElement();
       
    76 
       
    77     /*
       
    78      * 2nd phase constructor
       
    79      */
       
    80     void ConstructL(CPsData& aPsData);
       
    81 
       
    82 private:
       
    83 
       
    84     /*
       
    85      * Pointer to contact data
       
    86      * Not owned.
       
    87      */
       
    88     CPsData* psData;
       
    89 
       
    90     /*
       
    91      * This attribute indicates due to which
       
    92      * the data element this item entered the pool
       
    93      *
       
    94      * Bit 0 = Data1 matched
       
    95      * Bit 1 = Data2 matched
       
    96      * Bit 2 = Data3 matched
       
    97      * Bit 3 = Not used
       
    98      * Bit 4 = Not used
       
    99      * Bit 5 = Not used
       
   100      * Bit 6 = Not used
       
   101      * Bit 7 = Not used
       
   102      */
       
   103     TInt8 iDataMatchAttribute;
       
   104     };
       
   105 
       
   106 #endif // __CPCS_POOL_ELEMENT_ALGORITHM_2_H__
       
   107 // End of file