emailservices/emailstore/base_plugin/inc/baseplugincommonutils.h
branchRCL_3
changeset 16 b5fbb9b25d57
parent 0 8466d47a6819
child 24 d189ee25cf9d
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    47 template <class T> inline void CleanupResetAndDestroyClosePushL(T& aRef)
    47 template <class T> inline void CleanupResetAndDestroyClosePushL(T& aRef)
    48     {
    48     {
    49     CleanupResetAndDestroyClose<T>::PushL(aRef);
    49     CleanupResetAndDestroyClose<T>::PushL(aRef);
    50     }
    50     }
    51 
    51 
       
    52 /**
       
    53 * Cleanup support for owning pointer arrays
       
    54 */
       
    55 
       
    56 template<class T>
       
    57 class CleanupResetAndDestroy
       
    58 {
       
    59 private:
       
    60     inline static void ResetAndDestroy( TAny *aPtr )
       
    61     {
       
    62     reinterpret_cast<T*>( aPtr )->ResetAndDestroy();
       
    63     };
       
    64 public:
       
    65     inline static void PushL( T& aItem )
       
    66     { 
       
    67     TCleanupItem item( &CleanupResetAndDestroy::ResetAndDestroy, &aItem );
       
    68     CleanupStack::PushL( item );
       
    69     };
       
    70 } ;
       
    71 
       
    72 template <class T>
       
    73 inline void CleanupResetAndDestroyPushL( T& aRef )
       
    74     {
       
    75     CleanupResetAndDestroy<T>::PushL( aRef );
       
    76     }
       
    77 
       
    78 
    52 #endif
    79 #endif