locationrequestmgmt/locationserver/lbstestpsys/intgpspsy1/src/delaytimer.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "delaytimer.h"
       
    17 
       
    18 CDelayTimer::CDelayTimer()
       
    19  : CTimer(EPriorityStandard)
       
    20 {
       
    21     iSvrObject = NULL;
       
    22 	CActiveScheduler::Add(this);
       
    23 }
       
    24 
       
    25 void CDelayTimer::ConstructL()
       
    26 {
       
    27 	CTimer::ConstructL();
       
    28 }
       
    29 
       
    30 CDelayTimer::~CDelayTimer()
       
    31 {
       
    32 	Cancel();
       
    33 }
       
    34 
       
    35 void CDelayTimer::Start(
       
    36         const TInt aTimerId, 
       
    37         const TTimeIntervalMicroSeconds32 aDelay,
       
    38         MDelayTimerUser* aSvrObject)
       
    39 {
       
    40     __ASSERT_ALWAYS(aSvrObject != NULL, User::Panic(_L("DelayTimer"), KErrArgument));
       
    41 
       
    42 	iTimerId = aTimerId;
       
    43 	iSvrObject = aSvrObject;
       
    44 	After(aDelay);
       
    45 }
       
    46 
       
    47 void CDelayTimer::RunL()
       
    48 {
       
    49 	if (iSvrObject) iSvrObject->TimerCompleted(iTimerId);
       
    50 }
       
    51 
       
    52 TInt CDelayTimer::RunError(TInt /*aError*/)
       
    53 {
       
    54     return KErrNone;
       
    55 }