inc/cleanupresetanddestroy.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Utility class for putting to cleanup stack
       
    15 *                RPointerArray class which owns its members
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef _TR1SIDO_1_CLEANUPRESETANDDESTROY_H
       
    20 #define _TR1SIDO_1_CLEANUPRESETANDDESTROY_H
       
    21 // ----------------------------------------------------------------------------
       
    22 // CleanupUtility for RpointerArrays
       
    23 // Does RPointerArray< >->ResetAndDestroy() for the given array aPtr.
       
    24 //
       
    25 // Note: when using this class ensure that you include the header <e32base.h>
       
    26 // and you link against euser.lib
       
    27 // ----------------------------------------------------------------------------
       
    28 //
       
    29 template<typename T>
       
    30 class CleanupResetAndDestroy
       
    31     {
       
    32 public:
       
    33     /**
       
    34      Puts an item on the cleanup stack.
       
    35 
       
    36      @param  aRef
       
    37      The implementation information to be put on the cleanup stack.
       
    38      */
       
    39     inline static void PushL( T& aRef );
       
    40 private:
       
    41     static void ResetAndDestroy( TAny *aPtr );
       
    42     };
       
    43 
       
    44 #include "cleanupresetanddestroy.inl"
       
    45 //
       
    46 // ----------------------------------------------------------------------------
       
    47 // End of CleanupUtility for RpointerArrays
       
    48 // ----------------------------------------------------------------------------
       
    49 
       
    50 
       
    51 #endif // _TR1SIDO_1_CLEANUPRESETANDDESTROY_H