equal
deleted
inserted
replaced
|
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 "timeout.h" |
|
17 #include "qos_prot.h" |
|
18 |
|
19 // CModuleTimeout |
|
20 CModuleTimeout::CModuleTimeout(TCallBack& aCallBack, TInt aPriority) : |
|
21 CTimer(aPriority), iCallback(aCallBack.iFunction, aCallBack.iPtr) |
|
22 { |
|
23 } |
|
24 |
|
25 CModuleTimeout* CModuleTimeout::NewL(TCallBack& aCallback, TInt aPriority) |
|
26 { |
|
27 CModuleTimeout* timeout = new (ELeave) CModuleTimeout(aCallback, aPriority); |
|
28 CleanupStack::PushL(timeout); |
|
29 timeout->InitL(); |
|
30 CleanupStack::Pop(); |
|
31 return timeout; |
|
32 } |
|
33 |
|
34 void CModuleTimeout::Start(TUint aMicroSeconds) |
|
35 { |
|
36 if (!IsActive()) |
|
37 After(aMicroSeconds); |
|
38 } |
|
39 |
|
40 void CModuleTimeout::Restart(TUint aMicroSeconds) |
|
41 { |
|
42 if (IsActive()) |
|
43 Cancel(); |
|
44 After(aMicroSeconds); |
|
45 } |
|
46 |
|
47 void CModuleTimeout::InitL() |
|
48 { |
|
49 ConstructL(); |
|
50 CActiveScheduler::Add(this); |
|
51 } |
|
52 |