|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <e32svr.h> |
|
19 #include <e32std.h> |
|
20 #include <StifParser.h> |
|
21 #include <Stiftestinterface.h> |
|
22 #include <logcli.h> |
|
23 #include <logwrap.h> |
|
24 #include <LiwServiceHandler.h> |
|
25 #include <LiwCommon.h> |
|
26 |
|
27 #include "tlogprovidertest.h" |
|
28 |
|
29 #include "tcallback.h" |
|
30 #include "liwlogiter.h" |
|
31 #include"tconstants.h" |
|
32 // _LIT8(KLogIter , "Iterator") ; |
|
33 |
|
34 |
|
35 |
|
36 //------------------------------------------------------------- |
|
37 // Generic call back function implementation, used by logging |
|
38 // component |
|
39 //-------------------------------------------------------------- |
|
40 |
|
41 static TInt count = 0 ; |
|
42 |
|
43 //-------------------------------------------------------------- |
|
44 // Default constructor |
|
45 //-------------------------------------------------------------- |
|
46 |
|
47 tcallback :: tcallback() |
|
48 { |
|
49 iScheduler = new CActiveSchedulerWait() ; |
|
50 } |
|
51 |
|
52 //---------------------------------------------------------------- |
|
53 // Default destructor |
|
54 //---------------------------------------------------------------- |
|
55 |
|
56 tcallback :: ~tcallback() |
|
57 { |
|
58 delete iScheduler ; |
|
59 } |
|
60 |
|
61 //----------------------------------------------------------------- |
|
62 //Starts the async wait loop |
|
63 //----------------------------------------------------------------- |
|
64 |
|
65 |
|
66 void tcallback :: Start() |
|
67 { |
|
68 iScheduler->Start() ; |
|
69 } |
|
70 |
|
71 TInt tcallback :: HandleNotifyL(TInt aCmdId,TInt aEventId, |
|
72 CLiwGenericParamList& aEventParamList, |
|
73 const CLiwGenericParamList& aInParamList) |
|
74 { |
|
75 ++count ; |
|
76 TInt pos=0; |
|
77 const TLiwGenericParam *LogIterParam = aInParamList.FindFirst(pos , KLogIter) ; |
|
78 |
|
79 if(pos != KErrNotFound) |
|
80 { |
|
81 CLiwIterable *liwiter = (LogIterParam->Value()).AsIterable() ; |
|
82 liwiter->Reset() ; |
|
83 |
|
84 } |
|
85 |
|
86 aEventParamList.Reset(); |
|
87 //aInParamList.Reset(); |
|
88 /*(const_cast<CLiwGenericParamList&>(aInParamList)).Reset() ; |
|
89 delete &aEventParamList; |
|
90 delete &aInParamList;*/ |
|
91 if(count > 0) |
|
92 { |
|
93 if(iScheduler->IsStarted()) |
|
94 iScheduler->AsyncStop() ; |
|
95 } |
|
96 iRetVal = KErrNone ; |
|
97 |
|
98 |
|
99 |
|
100 } |