testexecmdw/tef/tef/test/regressiontest/testblock/inc/te_regblocktestactiveobjectwrapper.h
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     1 /*
       
     2 * Copyright (c) 2005-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 * @file
       
    16 * This contains CTEFIntegrationTestActiveObjectWrapper
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @test
       
    24  @internalComponent
       
    25 */
       
    26 
       
    27 #if (!defined __TE_REG_BLOCKTEST_ACTIVE_OBJECT_WRAPPER_H__)
       
    28 #define __TE_REG_BLOCKTEST_ACTIVE_OBJECT_WRAPPER_H__
       
    29 
       
    30 
       
    31 
       
    32 #include "te_regblocktestwrapper.h"
       
    33 
       
    34 class CTe_RegBlockTestActiveObjectWrapper : public CTe_RegBlockTestWrapper
       
    35 	{
       
    36 public:
       
    37 	CTe_RegBlockTestActiveObjectWrapper();
       
    38 	
       
    39 	static	CTe_RegBlockTestActiveObjectWrapper*	NewL();
       
    40 
       
    41 	virtual TAny*	GetObject() { return iActiveObject; }
       
    42 	inline virtual void	SetObjectL(TAny* aObject)
       
    43 		{
       
    44 		DestroyData();
       
    45 		iActiveObject	= static_cast<RTimer*> (aObject);
       
    46 		}
       
    47 		
       
    48 	inline virtual void	DisownObjectL() 
       
    49 		{
       
    50 		iActiveObject = NULL;
       
    51 		}
       
    52 
       
    53 	void DestroyData()
       
    54 		{
       
    55 		delete iActiveObject;
       
    56 		iActiveObject=NULL;
       
    57 		}
       
    58 
       
    59 	inline virtual TCleanupOperation CleanupOperation()
       
    60 		{
       
    61 		return CleanupOperation;
       
    62 		}
       
    63 
       
    64 private:
       
    65 	void ConstructL();
       
    66 
       
    67 	static void CleanupOperation(TAny* aAny)
       
    68 		{
       
    69 		RTimer* timer = static_cast<RTimer*>(aAny);
       
    70 		timer->Cancel();
       
    71 		timer->Close();
       
    72 		delete timer;
       
    73 		}
       
    74 	};
       
    75 
       
    76 #endif /* __TE_REG_BLOCKTEST_ACTIVE_OBJECT_WRAPPER_H__ */
       
    77