-
Notifications
You must be signed in to change notification settings - Fork 3
/
simClass.h
61 lines (48 loc) · 826 Bytes
/
simClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <bits/stdc++.h>
using namespace std;
class Page{
public:
int processId;
int pageNumber;
long long addedTime;
long long lastAccessedTime;
Page(){
addedTime = -1;
lastAccessedTime = -1;
}
};
class PageTableEntry{
public:
int frame;
int valid;
int pageNumber;
PageTableEntry(){
valid = 0;
frame = -1;
}
};
class Process {
public:
int processId;
int totalMemory;
vector<Page>pages;
vector<PageTableEntry>pageTable;
};
class MemoryEntry{
public:
int occupied;
int processId;
int pageNumber;
int usedBit;
MemoryEntry(){
occupied = 0;
processId = -1;
pageNumber = -1;
usedBit = 0;
}
};
class ProcessTraceEntry {
public:
int processId;
int memoryLocation;
};