nettools/conntest/inc/TimeOutTimer.h
changeset 0 857a3e953887
equal deleted inserted replaced
-1:000000000000 0:857a3e953887
       
     1 /*
       
     2 * Copyright (c) 2006 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: CTimeOutTimer is used to generate time out events
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __TIMEOUTTIMER_H__
       
    19 #define __TIMEOUTTIMER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class MTimeOutNotify;
       
    26 
       
    27 /**
       
    28 *  This class will notify an object after a specified timeout.
       
    29 */
       
    30 class CTimeOutTimer : public CTimer
       
    31 {
       
    32 public:
       
    33     
       
    34     /**
       
    35     * Create a CTimeOutTimer object
       
    36     * @param aPriority priority to use for this timer
       
    37     * @param aTimeOutNotify object to notify of timeout event
       
    38     * @result a pointer to the created instance of CTimeOutTimer
       
    39     */
       
    40     static CTimeOutTimer* NewL(const TInt aPriority, MTimeOutNotify& aTimeOutNotify);
       
    41     
       
    42     /**
       
    43     * Create a CTimeOutTimer object
       
    44     * @param aPriority priority to use for this timer
       
    45     * @param aTimeOutNotify object to notify of timeout event
       
    46     * @result a pointer to the created instance of CTimeOutTimer
       
    47     */
       
    48     static CTimeOutTimer* NewLC(const TInt aPriority, MTimeOutNotify& aTimeOutNotify);
       
    49     
       
    50     /**
       
    51     * Destroy the object and release all memory objects
       
    52     */
       
    53     ~CTimeOutTimer();
       
    54     
       
    55 protected: // From CTimer
       
    56     
       
    57     /**
       
    58     * Invoked when a timer event occurs
       
    59     */
       
    60     virtual void RunL();
       
    61     
       
    62 private:
       
    63     
       
    64     /**
       
    65     * Perform the first phase of two phase construction 
       
    66     * @param aPriority priority to use for this timer
       
    67     */
       
    68     CTimeOutTimer(const TInt aPriority, MTimeOutNotify& aTimeOutNotify);
       
    69     
       
    70     /**
       
    71     * Perform the second phase construction of a CTimeOutTimer 
       
    72     */
       
    73     void ConstructL();
       
    74     
       
    75 private:
       
    76     // Member variables
       
    77     MTimeOutNotify& iNotify;
       
    78 };
       
    79 
       
    80 #endif // __TIMEOUTTIMER_H__
       
    81