|
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 "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: timing services for AVC server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include "upnpavtimer.h" |
|
25 #include "upnpbrowsingsession.h" |
|
26 |
|
27 _LIT( KComponentLogfile, "upnpavcontrollerserver.txt"); |
|
28 #include "upnplog.h" |
|
29 |
|
30 // CONSTANTS |
|
31 const TInt KMillion = 1000000; |
|
32 |
|
33 // ============================ MEMBER FUNCTIONS ============================ |
|
34 |
|
35 // -------------------------------------------------------------------------- |
|
36 // CUPnPAVTimer::NewL |
|
37 // See upnpavtimer.h |
|
38 // -------------------------------------------------------------------------- |
|
39 CUPnPAVTimer* CUPnPAVTimer::NewL( MUPnPAVTimerCallback& aObserver, |
|
40 TAVTimerType aType ) |
|
41 { |
|
42 CUPnPAVTimer* timer = new(ELeave) CUPnPAVTimer( aObserver, aType ); |
|
43 CleanupStack::PushL( timer ); |
|
44 timer->ConstructL(); |
|
45 CleanupStack::Pop(); |
|
46 return timer; |
|
47 } |
|
48 |
|
49 // -------------------------------------------------------------------------- |
|
50 // CUPnPAVTimer::~CUPnPAVTimer |
|
51 // See upnpavtimer.h |
|
52 // -------------------------------------------------------------------------- |
|
53 CUPnPAVTimer::~CUPnPAVTimer() |
|
54 { |
|
55 Cancel(); |
|
56 } |
|
57 |
|
58 // -------------------------------------------------------------------------- |
|
59 // CUPnPAVTimer::CUPnPAVTimer |
|
60 // See upnpavtimer.h |
|
61 // -------------------------------------------------------------------------- |
|
62 CUPnPAVTimer::CUPnPAVTimer( MUPnPAVTimerCallback& aObserver, |
|
63 TAVTimerType aType ) : |
|
64 CTimer( EPriorityStandard ), |
|
65 iObserver( aObserver ), |
|
66 iTimerType( aType ) |
|
67 { |
|
68 CActiveScheduler::Add( this ); |
|
69 } |
|
70 |
|
71 // -------------------------------------------------------------------------- |
|
72 // CUPnPAVTimer::ConstructL |
|
73 // See upnpavtimer.h |
|
74 // -------------------------------------------------------------------------- |
|
75 void CUPnPAVTimer::ConstructL() |
|
76 { |
|
77 CTimer::ConstructL(); |
|
78 } |
|
79 |
|
80 // -------------------------------------------------------------------------- |
|
81 // CUPnPAVTimer::RunL |
|
82 // See upnpavtimer.h |
|
83 // -------------------------------------------------------------------------- |
|
84 void CUPnPAVTimer::RunL() |
|
85 { |
|
86 iObserver.UPnPAVTimerCallback( iTimerType ); |
|
87 } |
|
88 |
|
89 // -------------------------------------------------------------------------- |
|
90 // CUPnPAVTimer::Start |
|
91 // See upnpavtimer.h |
|
92 // -------------------------------------------------------------------------- |
|
93 void CUPnPAVTimer::Start( TInt aIntervalInSecs ) |
|
94 { |
|
95 __ASSERTD( !IsActive(), __FILE__, __LINE__ ) |
|
96 After( TTimeIntervalMicroSeconds32( aIntervalInSecs * KMillion ) ); |
|
97 } |
|
98 |
|
99 // end of file |