author | Matti Laitinen <matti.t.laitinen@nokia.com> |
Thu, 11 Feb 2010 15:52:57 +0200 | |
changeset 1 | 3ff3fecb12fe |
permissions | -rw-r--r-- |
1
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
17 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
18 |
#ifndef PROFILER_STATUS_CHECKER_H |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
19 |
#define PROFILER_STATUS_CHECKER_H |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
20 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
21 |
#include <e32std.h> |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
22 |
#include <e32base.h> |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
23 |
#include <e32property.h> // RProperty |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
24 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
25 |
// CONSTANTS |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
26 |
const TUid KEngineStatusPropertyCat = { 0x2001E5AD }; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
27 |
enum TEnginePropertyKeys |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
28 |
{ |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
29 |
EProfilerEngineStatus = 8 |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
30 |
}; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
31 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
32 |
// CLASS DECLARATIONS |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
33 |
class MProfilerStatusObserver |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
34 |
{ |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
35 |
public: // Enums |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
36 |
enum KProfilerStatus |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
37 |
{ |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
38 |
EIdle = 0, |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
39 |
EInitializing, |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
40 |
ERunning, |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
41 |
EStopping, |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
42 |
ERestarting |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
43 |
}; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
44 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
45 |
public: // New |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
46 |
virtual void HandleProfilerStatusChange( |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
47 |
KProfilerStatus aStatus ) = 0; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
48 |
virtual void HandleProfilerErrorL( |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
49 |
TInt aError ) = 0; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
50 |
}; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
51 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
52 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
53 |
class CProfilerEngineStatusChecker : public CActive |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
54 |
{ |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
55 |
public: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
56 |
inline static CProfilerEngineStatusChecker* CProfilerEngineStatusChecker::NewL(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
57 |
inline ~CProfilerEngineStatusChecker(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
58 |
inline void SetObserver(MProfilerStatusObserver* aObserver); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
59 |
inline TInt GetInitialState(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
60 |
private: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
61 |
inline CProfilerEngineStatusChecker(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
62 |
inline void ConstructL(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
63 |
inline void RunL(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
64 |
inline void DoCancel(); |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
65 |
private: |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
66 |
TInt iPrevStat; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
67 |
MProfilerStatusObserver* iObserver; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
68 |
RProperty iEngineStatus; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
69 |
}; |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
70 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
71 |
#include <piprofiler/ProfilerEngineStatusChecker.inl> |
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
72 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
73 |
|
3ff3fecb12fe
Add initial version of PI Profiler under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
74 |
#endif // PROFILER_STATUS_CHECKER_H |