|
1 /* |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: General purpose timer* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "CIptvTimer.h" |
|
23 #include "MIptvTimerObserver.h" |
|
24 |
|
25 // ========================= MEMBER FUNCTIONS ================================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CIptvTimer::NewL() |
|
29 // Two-phased constructor. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 EXPORT_C CIptvTimer* CIptvTimer::NewL(const TInt aPriority, |
|
33 MIptvTimerObserver& aTimerObserver) |
|
34 { |
|
35 CIptvTimer* self = CIptvTimer::NewLC(aPriority, aTimerObserver ); |
|
36 CleanupStack::Pop( self ); |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CIptvTimer::NewLC() |
|
42 // Two-phased constructor. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C CIptvTimer* CIptvTimer::NewLC(const TInt aPriority, |
|
46 MIptvTimerObserver& aTimerObserver) |
|
47 { |
|
48 CIptvTimer* self = new ( ELeave ) CIptvTimer(aPriority, aTimerObserver); |
|
49 CleanupStack::PushL( self ); |
|
50 self->ConstructL(); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CIptvTimer::CIptvTimer() |
|
56 // C++ default constructor can NOT contain any code, that might leave. |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 EXPORT_C CIptvTimer::CIptvTimer(const TInt aPriority, |
|
60 MIptvTimerObserver& aTimerObserver) |
|
61 : CTimer( aPriority ), iObserver( aTimerObserver ) |
|
62 { |
|
63 // No implementation required |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CIptvTimer::ConstructL() |
|
68 // Symbian 2nd phase constructor can leave. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 EXPORT_C void CIptvTimer::ConstructL() |
|
72 { |
|
73 CTimer::ConstructL(); |
|
74 CActiveScheduler::Add( this ); |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CIptvTimer::~CIptvTimer() |
|
79 // Destructor. |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 EXPORT_C CIptvTimer::~CIptvTimer() |
|
83 { |
|
84 // No implementation required |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CIptvTimer::RunL() |
|
89 // Called when operation completes. |
|
90 // ----------------------------------------------------------------------------- |
|
91 // |
|
92 EXPORT_C void CIptvTimer::RunL() |
|
93 { |
|
94 // Timer request has completed, so notify the timer's owner |
|
95 if ( iStatus == KErrNone ) |
|
96 { |
|
97 iObserver.TimerExpired(this); |
|
98 } |
|
99 } |
|
100 |
|
101 // End of File |