phonebookengines/VirtualPhonebook/VPbkSimStore/inc/CFindView.h
branchRCL_3
changeset 32 2828b4d142c0
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
--- a/phonebookengines/VirtualPhonebook/VPbkSimStore/inc/CFindView.h	Tue Apr 27 16:23:35 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/VPbkSimStore/inc/CFindView.h	Tue May 11 16:00:21 2010 +0300
@@ -113,6 +113,22 @@
         /// Own: match results (SIM indexes) from native view
         RArray<TInt> iSIMMatchedContacts;
     };
+
+// 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 VPbkSimStore