1173
|
1 #ifndef INCLUDED_MEMORY_ITERATOR
|
|
2 #define INCLUDED_MEMORY_ITERATOR
|
|
3
|
|
4 #include "MemList.h"
|
|
5 #include "MemorySegment.h"
|
|
6 #include "AddrList.h"
|
|
7 #include "SchedTask.h"
|
|
8
|
|
9 enum {
|
|
10
|
|
11 READ_WRITE,
|
|
12 READ,
|
|
13 WRITE,
|
|
14
|
|
15 };
|
|
16
|
|
17 class MemIterator {
|
|
18 public:
|
|
19
|
|
20 // 走査する アドレスリスト
|
|
21 AddrListPtr addr_list;
|
|
22
|
|
23 // 扱う MemorySegment のリスト
|
|
24 MemList *mem_list;
|
|
25
|
|
26 // ms の stage
|
|
27 MemorySegmentPtr read_ms;
|
|
28 MemorySegmentPtr exec_ms;
|
|
29 MemorySegmentPtr write_ms;
|
|
30 MemorySegmentPtr free_ms;
|
|
31
|
|
32 SchedTask *smanager;
|
|
33
|
|
34 MemIterator(AddrListPtr add_list, MemList *mem_list, int cmd, SchedTask *smanager);
|
|
35 ~MemIterator();
|
|
36
|
1175
|
37
|
|
38 MemorySegmentPtr (MemIterator::*get_ms)(void);
|
|
39
|
1173
|
40 int hasNext(void);
|
1175
|
41
|
1173
|
42 MemorySegmentPtr get_read_write_ms(void);
|
|
43 MemorySegmentPtr get_read_ms(void);
|
|
44 MemorySegmentPtr get_write_ms(void);
|
1175
|
45
|
|
46 void collect_ms(void);
|
|
47 void overwrite_list(AddrListPtr list);
|
|
48
|
1173
|
49 };
|
|
50
|
|
51 typedef MemIterator *MemIteratorPtr;
|
|
52
|
|
53 #endif
|