--- a/phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindView.h Tue Apr 27 16:23:35 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindView.h Tue May 11 16:00:21 2010 +0300
@@ -88,6 +88,7 @@
TInt& aMatchArrayIndex ) const;
void RemoveFromMatchArrayIfFound( const CViewContact& aContact );
TInt FindFromMatchArray( const CViewContact& aContact ) const;
+ void HeapSortL(RPointerArray<CCntModelViewContact> aViewContacts);
private: // Data
/// Own: the find policy
@@ -98,6 +99,21 @@
RPointerArray<CCntModelViewContact> iContactsModelMatchContacts;
};
+// CleanupStack helpers for item owning RPointerArrays
+template <class T>
+class CleanupResetAndDestroy
+ {
+public:
+ inline static void PushL(T& aRef)
+ { CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef)); }
+private:
+ inline static void ResetAndDestroy(TAny *aPtr)
+ { static_cast<T*>(aPtr)->ResetAndDestroy(); }
+ };
+
+template <class T>
+inline void CleanupResetAndDestroyPushL(T& aRef)
+ { CleanupResetAndDestroy<T>::PushL(aRef); }
} // namespace VPbkCntModel
#endif // VPBKCNTMODEL_CFINDVIEW_H