os/security/crypto/weakcryptospi/test/kms/private_include/test/kmstest.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-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 the License "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 * Inline function definitions for general utility functions which are used by all KMS test code.
    16 *
    17 */
    18 
    19 
    20 
    21 
    22 /**
    23  @file
    24 */
    25 
    26 #ifndef KMSTEST_INL
    27 #define KMSTEST_INL
    28 
    29 #include "kmstest.h"
    30 
    31 template <class T>
    32 inline T TAnyPtrToFuncPtr(TAny* aPtr)
    33 /**
    34 	ISO C++ doesn't allow converting directly between object and
    35 	function pointers, so this function goes via an integer.
    36 
    37 	@param	aPtr			Object pointer to convert to a (static) function pointer.
    38 	@return					Function pointer, where the exact type of the function is	
    39 							described by the T template parameter.
    40  */
    41 	{
    42 	TUint32 funcAsInt = reinterpret_cast<TUint32>(aPtr);
    43 	return reinterpret_cast<T>(funcAsInt);
    44 	}
    45 
    46 
    47 #endif
    48