bearermanagement/mpm/inc/mpmexpirytimer.h
branchRCL_3
changeset 55 fc7b30ed2058
equal deleted inserted replaced
54:984e13af52c4 55:fc7b30ed2058
       
     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 * Contributors:
       
    13 *
       
    14 * Description:  Declaration of class CMPMExpiryTimer.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPMEXPIRYTIMER_H
       
    19 #define MPMEXPIRYTIMER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>  
       
    23 #include <e32std.h>		
       
    24 
       
    25 #include "mpmexpirytimercallback.h"
       
    26 
       
    27 /**
       
    28 * Class that implements simple microsecond timer and callback.
       
    29 * @since 5.2
       
    30 */
       
    31 NONSHARABLE_CLASS( CMPMExpiryTimer ): public CTimer
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36     * New for calling the two-phased constructor.
       
    37     * @since 5.2
       
    38     * @param aCallback Pointer to the class where callback goes    
       
    39     * @param aTimeout Timeout value in microseconds
       
    40     * @return Pointer to created object instance
       
    41     */
       
    42     static CMPMExpiryTimer* NewL( MMPMExpiryTimerCallback& aCallback,
       
    43             TInt aTimeout);  
       
    44     
       
    45     /**
       
    46     * Starts up the timer.
       
    47     * @since 5.2
       
    48     */
       
    49     void Start();
       
    50     
       
    51 private:
       
    52     /**
       
    53     * C++ constructor.
       
    54     * @since 5.2
       
    55     * @param aCallback Pointer to the class where callback goes
       
    56     * @param aTimer Timeout value in microseconds
       
    57     */
       
    58     CMPMExpiryTimer( MMPMExpiryTimerCallback& aCallback,
       
    59             TInt aTimeout );
       
    60 
       
    61     /**
       
    62     * ConstructL.       
       
    63     * @since 5.2
       
    64     */
       
    65     void ConstructL();
       
    66 
       
    67     /**
       
    68     * RunL. Inherited from CTimer.       
       
    69     * @since 5.2
       
    70     */
       
    71     void RunL();
       
    72 
       
    73 private:
       
    74     /**
       
    75     * Callback reference.
       
    76     */
       
    77     MMPMExpiryTimerCallback& iCallback;
       
    78     
       
    79     /**
       
    80     * Timeout value in microseconds.
       
    81     */
       
    82     TInt iTimeout;
       
    83     };
       
    84 
       
    85 #endif // MPMEXPIRYTIMER_H