Update contrib.
1 // Copyright (c) 2007-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // @file basicwatcher.cpp
19 #include "BasicWatcher.h"
20 #include "testdebug.h"
22 namespace NUnitTesting_USBDI
25 CBasicWatcher::CBasicWatcher(const TCallBack& aCallBack,TInt aPriority)
28 iCompletionCode(KErrNone)
30 CActiveScheduler::Add(this);
33 CBasicWatcher::~CBasicWatcher()
40 void CBasicWatcher::DoCancel()
44 RDebug::Printf("Watch cancelled");
49 void CBasicWatcher::StartWatching()
53 if(iStatus != KRequestPending)
55 User::Panic(_L("iStatus has not been set to pending this will lead to E32USER-CBase Panic"),46);
61 void CBasicWatcher::RunL()
65 iCompletionCode = iStatus.Int();
66 User::LeaveIfError(iCallBack.CallBack());
70 TInt CBasicWatcher::RunError(TInt aError)
74 RDebug::Printf("Watcher code Left with %d",aError);