obex/obexprotocol/obextransport/src/ObexTransportUtil.cpp
changeset 57 f6055a57ae18
parent 0 d0791faffa3f
equal deleted inserted replaced
54:4dc88a4ac6f4 57:f6055a57ae18
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "ObexTransportUtil.h"
       
    17 #include "logger.h"
       
    18 
       
    19 /**
       
    20 Function passed in as a parameter to TCleanupItem constructor to 
       
    21 reset and destroy the received aPtr.
       
    22 
       
    23 @param aPtr a pointer to the object that is to be cleaned up
       
    24 */
       
    25 void ResetAndDestroy(TAny* aPtr)
       
    26 	{
       
    27 	reinterpret_cast<RImplInfoPtrArray*>(aPtr)->ResetAndDestroy();
       
    28 	}
       
    29 
       
    30 /**
       
    31 Function that creates a clean up item for the received, aArray and
       
    32 specifies the cleanup function, ResetAndDestroy. When the item is 
       
    33 removed from the cleanup stack the function, ResetAndDestroy will be
       
    34 called on aArray
       
    35 
       
    36 @param aArray the array to be pushed onto the cleanup stack
       
    37 */
       
    38 void CleanupResetAndDestroyPushL(RImplInfoPtrArray& aArray)
       
    39    	{  	    
       
    40 	TCleanupItem item(ResetAndDestroy, &aArray);
       
    41    	CleanupStack::PushL(item);
       
    42    	}
       
    43