perfsrv/analyzetool/dynamicmemoryhook/inc/analyzetooleventhandler.h
changeset 51 98307c651589
equal deleted inserted replaced
42:0ff24a8f6ca2 51:98307c651589
       
     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 "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:  Declaration of the class CLibraryEventHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ANALYZETOOLEVENTHANDLER_H
       
    20 #define ANALYZETOOLEVENTHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32cmn.h>
       
    24 #include <e32base.h>
       
    25 #include "codeblock.h"
       
    26 #include <analyzetool/analyzetool.h>
       
    27 #include "analyzetoolfilelog.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MAnalyzeToolEventhandlerNotifier;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Class for receiving library load/unlaod events from the kernel   
       
    36 */
       
    37 class CLibraryEventHandler : public CActive
       
    38     {
       
    39     
       
    40     public: 
       
    41 
       
    42         /**
       
    43         * C++ default constructor.
       
    44         * @param aAnalyzeTool A reference to the <code>RAnalyzeTool</code> 
       
    45                  which is used to observe kernel events 
       
    46         * @param aCodeblocks A reference to array of code segments
       
    47         * @param aProcessId A reference to the observed process id
       
    48         * @param aMutex A reference to mutex to schedule access to the 
       
    49         *                   shared resources
       
    50         * @param aNotifier A reference to notifier object which is used to 
       
    51         * 					inform killed threads
       
    52         * @param aLogOption Current used log option on allocator.
       
    53         */
       
    54         CLibraryEventHandler( RAnalyzeTool& aAnalyzeTool, 
       
    55                 RArray<TCodeblock>& aCodeblocks,
       
    56                 TUint aProcessId,
       
    57                 RMutex& aMutex,
       
    58                 MAnalyzeToolEventhandlerNotifier& aNotifier,
       
    59                 TUint32 aLogOption,
       
    60                 RATFileLog& iLogFile );
       
    61 
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         ~CLibraryEventHandler();
       
    66 
       
    67         /* Start receiving events from the kernel */
       
    68         void Start();
       
    69         
       
    70         /**
       
    71         * Returns eventhandler's state.
       
    72         * @return TBool ETrue if eventhandler is started, EFalse otherwise
       
    73         */
       
    74         TBool IsStarted();
       
    75 
       
    76     protected: // Functions from base classes
       
    77         
       
    78         /**
       
    79         * Process active object's task
       
    80         */
       
    81         void RunL();
       
    82 
       
    83         /**
       
    84         * Cancels active object's task
       
    85         */
       
    86         void DoCancel();
       
    87  
       
    88     private: // Member variables
       
    89 
       
    90         /* Handle to the analyze tool device driver*/
       
    91         RAnalyzeTool& iAnalyzeTool; 
       
    92 
       
    93         /* A reference to codeblocks of the observed process */
       
    94         RArray<TCodeblock>& iCodeblocks;
       
    95 
       
    96         /* The observered process id */ 
       
    97         TUint iProcessId;
       
    98 
       
    99         /* The library info */
       
   100         TLibraryEventInfo iLibraryInfo;
       
   101 
       
   102         /* The mutex for serializing access to the shared resources */
       
   103         RMutex& iMutex;
       
   104         
       
   105         /* Inform if handler is started */
       
   106         TBool iStarted;
       
   107         
       
   108         /* A reference to event handler notifier */
       
   109         MAnalyzeToolEventhandlerNotifier& iNotifier;
       
   110 
       
   111         /* Current used log option */
       
   112         TUint32 iLogOption;
       
   113         
       
   114         // TODO comment
       
   115 		/* */
       
   116 		RATFileLog& iLogFile;
       
   117     };
       
   118 
       
   119 #endif // ANALYZETOOLEVENTHANDLER_H
       
   120 
       
   121 // End of File