presencecache/presencecacheutils/inc/presenceobjecthelpers.h
branchRCL_3
changeset 32 2828b4d142c0
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
    59     // Hide constructor and destructor
    59     // Hide constructor and destructor
    60     PresenceCacheBuddyUtils();
    60     PresenceCacheBuddyUtils();
    61     ~PresenceCacheBuddyUtils();
    61     ~PresenceCacheBuddyUtils();
    62     };
    62     };
    63 
    63 
       
    64 // CleanupStack helpers for item owning RPointerArrays
       
    65 template <class T>
       
    66 class CleanupResetAndDestroy
       
    67     {
       
    68 public:
       
    69     inline static void PushL(T& aRef)
       
    70         { CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef)); }
       
    71 private:
       
    72     inline static void ResetAndDestroy(TAny *aPtr)
       
    73         { static_cast<T*>(aPtr)->ResetAndDestroy(); }
       
    74     };
       
    75 
       
    76 template <class T>
       
    77 inline void CleanupResetAndDestroyPushL(T& aRef)
       
    78     { CleanupResetAndDestroy<T>::PushL(aRef); }
    64 #endif // PRESENCEOBJECTHELPERS_H
    79 #endif // PRESENCEOBJECTHELPERS_H