javauis/javalegacyutils/src/TimeOutTimer.cpp
changeset 76 4ad59aaee882
parent 69 773449708c84
child 79 2f468c1958d0
equal deleted inserted replaced
69:773449708c84 76:4ad59aaee882
     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 EXPORT_C CTimeOutTimer* CTimeOutTimer::NewL(const TInt aPriority, MTimeOutNotify& aTimeOutNotify)
       
    32 {
       
    33     CTimeOutTimer *p = new(ELeave) CTimeOutTimer(aPriority);
       
    34     CleanupStack::PushL(p);
       
    35     p->ConstructL(aTimeOutNotify);
       
    36     CleanupStack::Pop();
       
    37     return p;
       
    38 }
       
    39 
       
    40 void CTimeOutTimer::ConstructL(MTimeOutNotify &aTimeOutNotify)
       
    41 {
       
    42     iNotify=&aTimeOutNotify;
       
    43     CTimer::ConstructL();
       
    44     CActiveScheduler::Add(this);
       
    45 }
       
    46 
       
    47 void CTimeOutTimer::RunL()
       
    48 // Timer request has completed, so notify the timer's owner
       
    49 {
       
    50     iNotify->TimerExpired();
       
    51 }
       
    52 
       
    53 //  End of File