Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include "ActiveCallbackBase.h"
20 CActiveCallbackBase::CActiveCallbackTimer* CActiveCallbackBase::CActiveCallbackTimer::NewL(CActive& aActive, TInt aPriority)
22 CActiveCallbackTimer* self=new (ELeave) CActiveCallbackTimer(aActive, aPriority);
23 CleanupStack::PushL(self);
25 CActiveScheduler::Add(self);
26 CleanupStack::Pop(self);
30 CActiveCallbackBase::CActiveCallbackTimer::CActiveCallbackTimer(CActive& aActive, TInt aPriority)
36 void CActiveCallbackBase::CActiveCallbackTimer::RunL()
38 if ( iStatus.Int()==KErrNone )
40 // Timer termiated without error
41 if ( iActive.IsActive() )
48 CActiveCallbackBase* CActiveCallbackBase::NewLC(CDataWrapperBase& aDataWrapperBase, TInt aPriority)
50 CActiveCallbackBase* self=new(ELeave) CActiveCallbackBase(aDataWrapperBase, aPriority);
51 CleanupStack::PushL(self);
56 CActiveCallbackBase* CActiveCallbackBase::NewL(CDataWrapperBase& aDataWrapperBase, TInt aPriority)
58 CActiveCallbackBase* self=CActiveCallbackBase::NewLC(aDataWrapperBase, aPriority);
63 CActiveCallbackBase::CActiveCallbackBase(CDataWrapperBase& aDataWrapperBase, TInt aPriority)
64 : CActiveCallback(aDataWrapperBase, aPriority)
65 , iDataWrapperBase(aDataWrapperBase)
70 void CActiveCallbackBase::ConstructL()
72 CActiveCallback::ConstructL();
73 iTimer=CActiveCallbackTimer::NewL(*this);
76 CActiveCallbackBase::~CActiveCallbackBase()
85 void CActiveCallbackBase::Activate(TInt aIndex, TInt aTimeout)
87 CActiveCallback::Activate(aIndex);
90 iTimer->After(aTimeout);
94 void CActiveCallbackBase::KillTimer()
96 if ( iTimer->IsActive() )
98 iDataWrapperBase.INFO_PRINTF1(_L("CActiveCallbackBase::KillTimer"));