tstaskmonitor/utils/inc/tsutils.h
changeset 80 397d00875918
equal deleted inserted replaced
73:4bc7b118b3df 80:397d00875918
       
     1 /*
       
     2 * Copyright (c) 2009 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 namespace TaskSwitcher {
       
    19     template <class T>
       
    20     void RPointerArrayCleanupMethod(TAny *aPtr)
       
    21     {
       
    22         static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy();
       
    23     }
       
    24 
       
    25     template <class T>
       
    26     void CleanupResetAndDestroyPushL(RPointerArray<T> &array) {
       
    27         CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array));            
       
    28     }
       
    29 }