testexecmdw/tef/tef/utils/src/teftimer.cpp
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 CTEFTimer
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @prototype
       
    24  @test
       
    25 */
       
    26 
       
    27 #include "teftimer.h"
       
    28 
       
    29 EXPORT_C CTEFTimer* CTEFTimer::NewL(MTEFTimerCallback& aCallback, TInt aPriority)
       
    30 /**
       
    31  * Two phase constructor
       
    32  *
       
    33  * @param	aCallback - owner to notify on completion of timer
       
    34  * @param	aPriority - priority of CActive
       
    35  *
       
    36  * @see		MTEFTimerCallback
       
    37  */
       
    38 	{
       
    39 	CTEFTimer*	ret=new (ELeave) CTEFTimer(aCallback, aPriority);
       
    40 	CleanupStack::PushL(ret);
       
    41 	ret->ConstructL();
       
    42 	CleanupStack::Pop(ret);
       
    43 	return ret;
       
    44 	}
       
    45 
       
    46 CTEFTimer::CTEFTimer(MTEFTimerCallback& aCallback, TInt aPriority)
       
    47 /**
       
    48  * Constructor
       
    49  *
       
    50  * @param	aCallback - owner to notify on completion of timer
       
    51  * @param	aPriority - priority of CActive
       
    52  *
       
    53  * @see		MTEFTimerCallback
       
    54  */
       
    55 :	CTimer(aPriority)
       
    56 ,	iCallback(aCallback)
       
    57 	{
       
    58 
       
    59 	}
       
    60 
       
    61 void CTEFTimer::ConstructL()
       
    62 /**
       
    63  * Second phase constructor
       
    64  *
       
    65  * @leave	system wide error
       
    66  */
       
    67 	{
       
    68 	CTimer::ConstructL();
       
    69 	CActiveScheduler::Add(this);
       
    70 	}
       
    71 
       
    72 void CTEFTimer::RunL()
       
    73 	{
       
    74 	iCallback.TimerCompleted();
       
    75 	}