|
1 // memoryaccesscmd.h |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 #ifndef MEMORYACCESSCMD_H |
|
13 #define MEMORYACCESSCMD_H |
|
14 |
|
15 #include <fshell/ioutils.h> |
|
16 #include <fshell/common.mmh> |
|
17 |
|
18 #ifdef FSHELL_MEMORY_ACCESS_SUPPORT |
|
19 #include <fshell/memoryaccess.h> |
|
20 #endif |
|
21 |
|
22 namespace IoUtils |
|
23 { |
|
24 |
|
25 /* CMemoryAccessCommandBase |
|
26 * This class is intended to be used by commands that can make use of memory access but don't |
|
27 * necessarily require it. By deriving from CMemoryAccessCommandBase instead of CCommandBase, |
|
28 * you reduce the number of times "#ifdef FSHELL_MEMORY_ACCESS_SUPPORT" needs sprinkling through |
|
29 * your code. The only bits you need to guard are the bits that use iMemAccess and that call |
|
30 * LoadMemoryAccessL (although you could trap that instead if you really wanted). No need to |
|
31 * include memoryaccess.h or close iMemAccess, and you can include this header and derive from |
|
32 * this class unconditionally. |
|
33 */ |
|
34 |
|
35 class CMemoryAccessCommandBase : public CCommandBase |
|
36 { |
|
37 public: |
|
38 IMPORT_C CMemoryAccessCommandBase(); |
|
39 IMPORT_C CMemoryAccessCommandBase(TUint aFlags); |
|
40 |
|
41 IMPORT_C void LoadMemoryAccessL(); |
|
42 IMPORT_C ~CMemoryAccessCommandBase(); |
|
43 |
|
44 #ifdef FSHELL_MEMORY_ACCESS_SUPPORT |
|
45 protected: |
|
46 RMemoryAccess iMemAccess; |
|
47 #else |
|
48 private: |
|
49 // So that we're the same size regardless |
|
50 TUint32 iPadding[3]; |
|
51 #endif |
|
52 }; |
|
53 |
|
54 } |
|
55 |
|
56 #endif // MEMORYACCESSCMD_H |