author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 May 2010 14:17:14 +0300 | |
changeset 139 | 95f71bcdcdb7 |
parent 90 | 947f0dc9f7a8 |
child 151 | b5dd6d3f5c21 |
child 189 | a5496987b1da |
permissions | -rw-r--r-- |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 2 |
// All rights reserved. |
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "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 |
/** Event handler and container for all objects being tracked. */ |
|
17 |
#ifndef __RM_DEBUG_EVENTHANDLER_H__ |
|
18 |
#define __RM_DEBUG_EVENTHANDLER_H__ |
|
19 |
||
20 |
||
21 |
class DRM_DebugEventHandler : public DKernelEventHandler |
|
22 |
{ |
|
23 |
public: |
|
24 |
DRM_DebugEventHandler(); |
|
25 |
TInt Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient); |
|
26 |
~DRM_DebugEventHandler(); |
|
27 |
TInt Start(); |
|
28 |
TInt Stop(); |
|
29 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
30 |
inline void DRM_DebugEventHandler::LockDataAccess() |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
31 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
32 |
Kern::SemaphoreWait(*iProtectionLock); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
inline void DRM_DebugEventHandler::ReleaseDataAccess() |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
36 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
37 |
Kern::SemaphoreSignal(*iProtectionLock); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
39 |
|
0 | 40 |
private: |
41 |
static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis); |
|
42 |
TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2); |
|
43 |
TBool HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2); |
|
44 |
||
45 |
private: |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
46 |
/** Used to serialise access data structures */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
47 |
DSemaphore* iProtectionLock; |
0 | 48 |
|
49 |
TBool iTracking; |
|
50 |
||
51 |
DLogicalDevice* iDevice; // open reference to LDD for avoiding lifetime issues |
|
52 |
DThread* iClientThread; |
|
53 |
DRM_DebugChannel* iChannel; |
|
54 |
||
55 |
// typdef for functions which handle our specific events |
|
56 |
typedef TBool (DRM_DebugChannel::*eventHandler)(TAny* a1, TAny* a2); |
|
57 |
eventHandler iEventHandlers[EEventLimit]; |
|
58 |
}; |
|
59 |
||
60 |
#endif //__RM_DEBUG_EVENTHANDLER_H__ |