voipplugins/voipadapters/voipxmlprovisioning/voipxmlprocessor/inc/voipxmlutils.inl
changeset 2 7b872347d83b
child 12 876a3df1f464
equal deleted inserted replaced
1:bfb1de3eac8e 2:7b872347d83b
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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:  Utilities methods for VoIP XML processor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "voipxmlutils.h"
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // Pushes an item to CleanupStack.
       
    23 // ---------------------------------------------------------------------------
       
    24 //
       
    25 template <class T>
       
    26 inline void CleanupResetAndDestroy<T>::PushL( T& aRef )
       
    27     {
       
    28     CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) );
       
    29     }
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // Cleans up an item.
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 template <class T>
       
    36 inline void CleanupResetAndDestroy<T>::ResetAndDestroy( TAny *aPtr )
       
    37     {
       
    38     ( STATIC_CAST( T*, aPtr ) )->ResetAndDestroy();
       
    39     ( STATIC_CAST( T*, aPtr ) )->Close();
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // Calls CleanupResetAndDestroy<T>::PushL
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 template <class T>
       
    47 inline void CleanupResetAndDestroyL( T& aRef )
       
    48     {
       
    49     CleanupResetAndDestroy<T>::PushL( aRef );
       
    50     }
       
    51 
       
    52 // End of file.
       
    53