equal
deleted
inserted
replaced
|
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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #include "delay.h" |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <bluetooth/logger.h> |
|
25 |
|
26 #ifdef __FLOG_ACTIVE |
|
27 _LIT8(KLogComponent, LOG_COMPONENT_HCTL_BASE); |
|
28 #endif |
|
29 |
|
30 /** |
|
31 Factory function. |
|
32 @param aCallback The callback function |
|
33 @param aPriority The Active Object priority of the timer used for the delay. |
|
34 @return Ownership of a new CDelay. |
|
35 */ |
|
36 EXPORT_C CDelay* CDelay::NewL(TCallBack& aCallback, TPriority aPriority) |
|
37 { |
|
38 LOG_STATIC_FUNC |
|
39 |
|
40 CDelay* self = new(ELeave) CDelay(aCallback, aPriority); |
|
41 CleanupStack::PushL(self); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop(self); |
|
44 return self; |
|
45 } |
|
46 |
|
47 CDelay::CDelay(TCallBack& aCallback, TPriority aPriority) |
|
48 : CTimer(aPriority), |
|
49 iCallback(aCallback) |
|
50 { |
|
51 LOG_FUNC |
|
52 |
|
53 CActiveScheduler::Add(this); |
|
54 } |
|
55 |
|
56 EXPORT_C CDelay::~CDelay() |
|
57 { |
|
58 LOG_FUNC |
|
59 |
|
60 Cancel(); |
|
61 } |
|
62 |
|
63 void CDelay::RunL() |
|
64 { |
|
65 LOG_LINE |
|
66 LOG_FUNC |
|
67 LOG1(_L8("\tiStatus = %d"), iStatus.Int()); |
|
68 |
|
69 // Ignore any return value from the callback function. |
|
70 (void)(iCallback.CallBack()); |
|
71 } |