keepalive/flextimer/server/engine/inc/flextimerwakeuptimer.h
changeset 32 5c4486441ae6
equal deleted inserted replaced
31:c16e04725da3 32:5c4486441ae6
       
     1 /*
       
     2  * Copyright (c) 2010 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  * Description:
       
    13  * This class contains definition of CFlexTimerWakeUpTimer.
       
    14  *
       
    15  */
       
    16 
       
    17 // Protection against nested includes
       
    18 #ifndef FLEXTIMERWAKEUPTIMER_H
       
    19 #define FLEXTIMERWAKEUPTIMER_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // User includes
       
    25 // None
       
    26 
       
    27 // Forward declarations
       
    28 class MFlexTimerWakeUpTimerCB;
       
    29 
       
    30 // Class declaration
       
    31 /**
       
    32  *  This class implements timer that is used to
       
    33  *  - Inform timer engine that timeout algorithms should be excecuted
       
    34  *  - Inform timer engine that system time has changed.
       
    35  *
       
    36  */
       
    37 class CFlexTimerWakeUpTimer : public CTimer
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Contructs new wake up timer
       
    43      * @param aObserver callback class
       
    44      *
       
    45      */
       
    46     static CFlexTimerWakeUpTimer* NewL( MFlexTimerWakeUpTimerCB& aObserver );
       
    47 
       
    48     /**
       
    49      * Destructs wake up timer.
       
    50      */
       
    51     virtual ~CFlexTimerWakeUpTimer();
       
    52 
       
    53 public:
       
    54     /**
       
    55      * Starts timer. No need to cancel already running timer.
       
    56      * @param aInterval time until timer should expire         
       
    57      */
       
    58 
       
    59     void StartTimer( TTimeIntervalMicroSeconds& aInterval );
       
    60     
       
    61     /**
       
    62      * Stops timer.   
       
    63      */
       
    64     void StopTimer();
       
    65 
       
    66     /**
       
    67      * Inherited from CActive
       
    68      * Handles timer expiration and callbacks.
       
    69      */
       
    70     void RunL();
       
    71 
       
    72 private:
       
    73     // Functions
       
    74     /**
       
    75      * Private contructor.
       
    76      * @param aObserver Callback class.         
       
    77      */
       
    78     CFlexTimerWakeUpTimer( MFlexTimerWakeUpTimerCB& aObserver );
       
    79     /**
       
    80      * Private 2nd phase contructor.   
       
    81      */
       
    82     void ConstructL();
       
    83 
       
    84 private:
       
    85     // Data
       
    86     /**
       
    87      * Callback class
       
    88      */
       
    89     MFlexTimerWakeUpTimerCB& iObserver;
       
    90 
       
    91     };
       
    92 
       
    93 #endif  //FLEXTIMERWAKEUPTIMER_H