uifw/ganes/src/HgVgTimer.cpp
changeset 47 2f0c06423c72
parent 46 0e1e0022bd03
child 53 3c67ea82fafc
equal deleted inserted replaced
46:0e1e0022bd03 47:2f0c06423c72
     1 /*
       
     2 * Copyright (c) 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 FILES
       
    19 
       
    20 #include "HgVgTimer.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 // -----------------------------------------------------------------------------
       
    24 // CHgVgTimer::NewL()
       
    25 // Two-phased constructor.
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 CHgVgTimer* CHgVgTimer::NewL()
       
    29     {
       
    30     CHgVgTimer* self = new ( ELeave ) CHgVgTimer();
       
    31     CleanupStack::PushL (self );
       
    32     self->ConstructL( );
       
    33     CleanupStack::Pop ( self );
       
    34     return self;
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CHgVgTimer::CHgVgTimer()
       
    39 // C++ default constructor can NOT contain any code, that might leave.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CHgVgTimer::CHgVgTimer() : CTimer(CActive::EPriorityStandard)
       
    43     {
       
    44     CActiveScheduler::Add( this );
       
    45     }
       
    46         
       
    47 // -----------------------------------------------------------------------------
       
    48 // CHgVgTimer::~CHgVgTimer()
       
    49 // Destructor.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CHgVgTimer::~CHgVgTimer ( )
       
    53     {
       
    54     Cancel();
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CHgVgTimer::Start()
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 void CHgVgTimer::Start( TTimeIntervalMicroSeconds32 aDelay,
       
    62                                  TTimeIntervalMicroSeconds32 aInterval,
       
    63                                  TCallBack aCallBack)
       
    64     {
       
    65     iInterval = aInterval.Int();
       
    66     iCallBack = aCallBack;
       
    67     HighRes( aDelay );
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CHgVgTimer::RunL()
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 void CHgVgTimer::RunL()
       
    75     {
       
    76     HighRes(iInterval);
       
    77     iCallBack.CallBack(); 
       
    78     }
       
    79 
       
    80 // End of File