|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MEMSPYENGINECHUNKWATCHER_H |
|
19 #define MEMSPYENGINECHUNKWATCHER_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // Classes referenced |
|
25 class RMemSpyDriverClient; |
|
26 |
|
27 |
|
28 class MMemSpyEngineChunkWatcherObserver |
|
29 { |
|
30 public: // From MMemSpyEngineChunkWatcherObserver |
|
31 virtual void HandleChunkAddL( TUint aChunkHandle ) = 0; |
|
32 virtual void HandleChunkDestroyL( TUint aChunkHandle ) = 0; |
|
33 }; |
|
34 |
|
35 |
|
36 NONSHARABLE_CLASS( CMemSpyEngineChunkWatcher ) : public CActive |
|
37 { |
|
38 public: |
|
39 static CMemSpyEngineChunkWatcher* NewL( RMemSpyDriverClient& aDriver, TInt aPriority = CActive::EPriorityStandard ); |
|
40 ~CMemSpyEngineChunkWatcher(); |
|
41 |
|
42 private: |
|
43 CMemSpyEngineChunkWatcher( RMemSpyDriverClient& aDriver, TInt aPriority ); |
|
44 void ConstructL(); |
|
45 |
|
46 public: // API |
|
47 void AddObserverL( MMemSpyEngineChunkWatcherObserver& aObserver ); |
|
48 void RemoveObserver( MMemSpyEngineChunkWatcherObserver& aObserver ); |
|
49 |
|
50 private: // From CActive |
|
51 void RunL(); |
|
52 void DoCancel(); |
|
53 |
|
54 private: // Internal methods |
|
55 void Request(); |
|
56 void NotifyChunkAddL( TUint aChunkHandle ); |
|
57 void NotifyChunkDestroyL( TUint aChunkHandle ); |
|
58 |
|
59 private: // Data members |
|
60 TUint iId; |
|
61 TUint iEventMonitorHandle; |
|
62 RMemSpyDriverClient& iDriver; |
|
63 RPointerArray< MMemSpyEngineChunkWatcherObserver > iObservers; |
|
64 }; |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 #endif |