56
|
1 |
// Copyright (c) 2007-2010 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 "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 |
// Base class for trace core handlers.
|
|
15 |
//
|
|
16 |
|
|
17 |
#ifndef __TRACECOREHANDLER_H__
|
|
18 |
#define __TRACECOREHANDLER_H__
|
|
19 |
|
|
20 |
|
|
21 |
// Include files
|
|
22 |
#include <kernel/kernel.h>
|
|
23 |
|
|
24 |
|
|
25 |
// Forward declarations
|
|
26 |
class DTraceCoreSettings;
|
|
27 |
class DTraceCoreWriter;
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Base class for trace core handlers. A handler receives trace data and delegates it to writer
|
|
32 |
*/
|
|
33 |
NONSHARABLE_CLASS( DTraceCoreHandler ) : public DBase
|
|
34 |
{
|
|
35 |
public:
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Constructor
|
|
39 |
*/
|
|
40 |
DTraceCoreHandler();
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Destructor
|
|
44 |
*/
|
|
45 |
~DTraceCoreHandler();
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Registers this handler to trace core.
|
|
49 |
*/
|
|
50 |
TInt Register();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Called before SetWriter with interrupts enabled
|
|
54 |
*
|
|
55 |
* @param aWriter The new writer
|
|
56 |
*/
|
|
57 |
virtual void PrepareSetWriter( DTraceCoreWriter* aWriter );
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Sets the active writer. This is called with interrupts disabled
|
|
61 |
*
|
|
62 |
* @param aWriter The new writer
|
|
63 |
*/
|
|
64 |
virtual void SetWriter( DTraceCoreWriter* aWriter );
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Sets the settings (saver). Called by trace core
|
|
68 |
*
|
|
69 |
* @param aSettings The new settings
|
|
70 |
*/
|
|
71 |
virtual void SetSettings( DTraceCoreSettings* aSettings );
|
|
72 |
|
|
73 |
private:
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Unregisters this handler from trace core. Called from destructor
|
|
77 |
*/
|
|
78 |
void Unregister();
|
|
79 |
|
|
80 |
protected:
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Writer interface
|
|
84 |
*/
|
|
85 |
DTraceCoreWriter* iWriter;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Settings interface
|
|
89 |
*/
|
|
90 |
DTraceCoreSettings* iSettings;
|
|
91 |
|
|
92 |
};
|
|
93 |
|
|
94 |
#endif
|
|
95 |
|
|
96 |
// End of File
|