usbmgmt/usbmgr/usbman/server/SRC/UsbUtils.cpp
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 1997-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 #include <e32std.h>
       
    19 #include <e32base.h>
       
    20 #include "UsbUtils.h"
       
    21 
       
    22 void ResetAndDestroy(TAny* aPtr)
       
    23 /**
       
    24  *Function passed in as a parameter to TCleanupItem constructor to 
       
    25  *reset and destroy the received aPtr.
       
    26  *
       
    27  *aPtr object
       
    28  *
       
    29  *@param aPtr a pointer to the object that is to be cleaned up
       
    30  */
       
    31 	{
       
    32 	reinterpret_cast<RImplInfoPtrArray*>(aPtr)->ResetAndDestroy();
       
    33 	}
       
    34 
       
    35 void CleanupResetAndDestroyPushL(RImplInfoPtrArray& aArray)
       
    36 /**
       
    37  *Function that creates a clean up item for the received, aArray and
       
    38  *specifies the cleanup function, ResetAndDestroy. When the item is 
       
    39  *removed from the cleanup stack the function, ResetAndDestroy will be
       
    40  *called on aArray
       
    41  *
       
    42  *@param aArray the array to be pushed onto the cleanup stack
       
    43  */
       
    44    	{  	    
       
    45 	TCleanupItem item(ResetAndDestroy, &aArray);
       
    46    	CleanupStack::PushL(item);
       
    47    	}
       
    48 //
       
    49 // End of file