71 { |
71 { |
72 return iPsData; |
72 return iPsData; |
73 } |
73 } |
74 |
74 |
75 // ---------------------------------------------------------------------------- |
75 // ---------------------------------------------------------------------------- |
76 // CPcsPoolElement::CompareByDataL |
76 // CPcsPoolElement::CompareByData |
77 // |
77 // Calls CPsData::CompareByData to compare CPsData objects |
78 // |
78 // |
79 // ---------------------------------------------------------------------------- |
79 // ---------------------------------------------------------------------------- |
80 TInt CPcsPoolElement::CompareByDataL ( const CPcsPoolElement& aObject1, const CPcsPoolElement& aObject2 ) |
80 TInt CPcsPoolElement::CompareByData ( const CPcsPoolElement& aObject1, const CPcsPoolElement& aObject2 ) |
81 { |
81 { |
82 CPsData *data1 = const_cast<CPcsPoolElement&> (aObject1).GetPsData(); |
82 CPsData *data1 = const_cast<CPcsPoolElement&> (aObject1).GetPsData(); |
83 CPsData *data2 = const_cast<CPcsPoolElement&> (aObject2).GetPsData(); |
83 CPsData *data2 = const_cast<CPcsPoolElement&> (aObject2).GetPsData(); |
84 return (CPcsAlgorithm2Utils::CompareDataBySortOrderL(*(data1), *(data2))); |
84 return (CPcsAlgorithm2Utils::CompareDataBySortOrder(*(data1), *(data2))); |
85 } |
85 } |
86 |
86 |
87 // CPcsPoolElement::IsDataMatch |
87 // CPcsPoolElement::IsDataMatch |
88 // |
88 // |
89 // ---------------------------------------------------------------------------- |
89 // ---------------------------------------------------------------------------- |
90 TBool CPcsPoolElement::IsDataMatch(TInt aIndex) |
90 TBool CPcsPoolElement::IsDataMatch (TInt aIndex) |
91 { |
91 { |
92 __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPcsPoolElement"), KErrOverflow ) ); |
92 TReal val; |
93 TUint8 val = 1 << aIndex; |
93 Math::Pow(val, 2, aIndex); |
94 return (iDataMatchAttribute & val); |
94 |
|
95 return(iDataMatchAttribute & (TUint8)val); |
95 } |
96 } |
96 |
97 |
97 // ---------------------------------------------------------------------------- |
98 // ---------------------------------------------------------------------------- |
98 // CPcsPoolElement::SetDataMatch |
99 // CPcsPoolElement::SetDataMatch |
99 // |
100 // |
100 // ---------------------------------------------------------------------------- |
101 // ---------------------------------------------------------------------------- |
101 void CPcsPoolElement::SetDataMatch(TInt aIndex) |
102 void CPcsPoolElement::SetDataMatch(TInt aIndex) |
102 { |
103 { |
103 __ASSERT_DEBUG( aIndex < 8, User::Panic( _L("CPcsPoolElement"), KErrOverflow ) ); |
104 TReal val; |
104 TUint8 val = 1 << aIndex; |
105 Math::Pow(val, 2, aIndex); |
105 iDataMatchAttribute |= val; |
106 |
|
107 iDataMatchAttribute |= (TUint8)val; |
106 } |
108 } |
107 |
109 |
108 // ---------------------------------------------------------------------------- |
110 // ---------------------------------------------------------------------------- |
109 // CPcsPoolElement::ClearDataMatchAttribute |
111 // CPcsPoolElement::ClearDataMatchAttribute |
110 // |
112 // |