|
1 // Copyright (c) 2006-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 // Name : TimerBase.cpp |
|
15 // Part of : TransactionUser |
|
16 // Version : SIP/6.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "TimerBase.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // CTimerBase::CTimerBase |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 CTimerBase::CTimerBase(MTimerManager& aTimerMgr, |
|
28 MExpirationHandler* aObserver, |
|
29 TUint32 aDuration) : |
|
30 iTimerMgr(aTimerMgr), |
|
31 iObserver(aObserver), |
|
32 iDuration(aDuration) |
|
33 { |
|
34 __ASSERT_DEBUG(aObserver, User::Panic(_L("CTimerBase"), KErrArgument)); |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CTimerBase::ConstructL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 void CTimerBase::ConstructL() |
|
42 { |
|
43 iId = iTimerMgr.StartL(iObserver, iDuration, this); |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CTimerBase::~CTimerBase |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CTimerBase::~CTimerBase() |
|
51 { |
|
52 Stop(); |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CTimerBase::Stop |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 void CTimerBase::Stop() |
|
60 { |
|
61 iTimerMgr.Stop(iId); |
|
62 iId = MTimerManager::KNoSuchTimer; |
|
63 } |