javauis/mmapi_qt/utils/src/TimeOutTimer.cpp
branchRCL_3
changeset 18 9ac0a0a7da70
parent 17 0fd27995241b
child 19 71c436fe3ce0
equal deleted inserted replaced
17:0fd27995241b 18:9ac0a0a7da70
     1 /*
       
     2 * Copyright (c) 2003 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:  Timer for comms time-outs
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "TimeOutTimer.h"
       
    20 
       
    21 CTimeOutTimer::CTimeOutTimer(const TInt aPriority)
       
    22         : CTimer(aPriority)
       
    23 {
       
    24 }
       
    25 
       
    26 CTimeOutTimer::~CTimeOutTimer()
       
    27 {
       
    28     Cancel();
       
    29 }
       
    30 
       
    31 
       
    32 EXPORT_C CTimeOutTimer* CTimeOutTimer::NewL(const TInt aPriority, MTimeOutNotify& aTimeOutNotify)
       
    33 {
       
    34     CTimeOutTimer *p = new(ELeave) CTimeOutTimer(aPriority);
       
    35     CleanupStack::PushL(p);
       
    36     p->ConstructL(aTimeOutNotify);
       
    37     CleanupStack::Pop();
       
    38     return p;
       
    39 }
       
    40 
       
    41 void CTimeOutTimer::ConstructL(MTimeOutNotify &aTimeOutNotify)
       
    42 {
       
    43     iNotify=&aTimeOutNotify;
       
    44     CTimer::ConstructL();
       
    45     CActiveScheduler::Add(this);
       
    46 }
       
    47 
       
    48 void CTimeOutTimer::RunL()
       
    49 // Timer request has completed, so notify the timer's owner
       
    50 {
       
    51     iNotify->TimerExpired();
       
    52 }
       
    53 
       
    54 //  End of File