kernel/eka/include/drivers/rm_debug_eventhandler.h
changeset 0 a41df078684a
child 21 e7d2d738d3c2
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2004-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 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 		
       
    30 	private:
       
    31 		static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis);
       
    32 		TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2);
       
    33 		TBool HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2);
       
    34 		
       
    35 	private:
       
    36 		/** Lock serialising calls to event handler */
       
    37 		DSemaphore* iLock;
       
    38 
       
    39 		TBool iTracking;
       
    40 
       
    41 		DLogicalDevice* iDevice;	// open reference to LDD for avoiding lifetime issues
       
    42 		DThread* iClientThread;
       
    43 		DRM_DebugChannel* iChannel;
       
    44 
       
    45 		// typdef for functions which handle our specific events
       
    46 		typedef TBool (DRM_DebugChannel::*eventHandler)(TAny* a1, TAny* a2);
       
    47 		eventHandler iEventHandlers[EEventLimit];
       
    48 };
       
    49 
       
    50 #endif //__RM_DEBUG_EVENTHANDLER_H__