sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** Event handler and container for all objects being tracked. */ sl@0: #ifndef __RM_DEBUG_EVENTHANDLER_H__ sl@0: #define __RM_DEBUG_EVENTHANDLER_H__ sl@0: sl@0: sl@0: class DRM_DebugEventHandler : public DKernelEventHandler sl@0: { sl@0: public: sl@0: DRM_DebugEventHandler(); sl@0: TInt Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient); sl@0: ~DRM_DebugEventHandler(); sl@0: TInt Start(); sl@0: TInt Stop(); sl@0: sl@0: private: sl@0: static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis); sl@0: TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2); sl@0: TBool HandleSpecificEvent(TKernelEvent aType, TAny* a1, TAny* a2); sl@0: sl@0: private: sl@0: /** Lock serialising calls to event handler */ sl@0: DSemaphore* iLock; sl@0: sl@0: TBool iTracking; sl@0: sl@0: DLogicalDevice* iDevice; // open reference to LDD for avoiding lifetime issues sl@0: DThread* iClientThread; sl@0: DRM_DebugChannel* iChannel; sl@0: sl@0: // typdef for functions which handle our specific events sl@0: typedef TBool (DRM_DebugChannel::*eventHandler)(TAny* a1, TAny* a2); sl@0: eventHandler iEventHandlers[EEventLimit]; sl@0: }; sl@0: sl@0: #endif //__RM_DEBUG_EVENTHANDLER_H__