piprofiler/engine/inc/ProfilerTimer.h
branchRCL_3
changeset 13 da2cedce4920
equal deleted inserted replaced
12:d27dfa8884ad 13:da2cedce4920
       
     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 #ifndef PROFILERTIMER_H_
       
    19 #define PROFILERTIMER_H_
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 
       
    24 class MProfilerTimerObserver
       
    25     {
       
    26 public:
       
    27     virtual void HandleTimerExpiresL(TInt aError) = 0;
       
    28     };
       
    29 
       
    30 class CProfilerTimer : public CActive
       
    31     {
       
    32 public:
       
    33     static CProfilerTimer* NewL(const TInt aPriority, MProfilerTimerObserver& aObserver);
       
    34     ~CProfilerTimer();
       
    35     
       
    36 public:
       
    37     
       
    38     void After(TUint aPeriodInSeconds);
       
    39     
       
    40 protected:
       
    41     
       
    42     // From CActive
       
    43     void RunL();
       
    44     void DoCancel();
       
    45     
       
    46 private:
       
    47     
       
    48     CProfilerTimer(const TInt aPriority, MProfilerTimerObserver& aObserver);
       
    49     void ConstructL(void);
       
    50     
       
    51 private:
       
    52     
       
    53     RTimer      iTimer;
       
    54     MProfilerTimerObserver&    iObserver;
       
    55     };
       
    56 
       
    57 #endif /* PROFILERTIMER_H_ */