--- a/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2Utils.h Mon Mar 15 12:39:26 2010 +0200
+++ b/predictivesearch/PcsAlgorithm/Algorithm2/inc/CPcsAlgorithm2Utils.h Wed Mar 31 21:13:53 2010 +0300
@@ -64,4 +64,21 @@
static TBool IsGroupUri(TDesC& aURI);
};
+
+// 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); }
+
#endif // C_PCS_ALGORITHM_2_UTILS