-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.h
47 lines (42 loc) · 1.15 KB
/
process.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
// Muhammad Rohaan Atique - 20I-0410
// Muhammad Usman Kamal - 20i-0562
// process.h
#pragma once
#include <iostream>
using namespace std;
struct PCBstruct {
int PID;
string PName;
int Priority;
char procType;
string state;
};
class Process {
public:
PCBstruct PCB;
double arrivalTime;
double CPUTime;
int IOTime;
bool isExecuted;
clock_t readyArrival;
double timeInReady;
// loading all the process data
Process() {
//For array declaration;
}
Process (int PID, string PName, int Priority, double arrivalTime, char procType, double CPUTime, int IOTime) {
this -> PCB.PID = PID;
this -> PCB.PName = PName;
this -> PCB.Priority = Priority;
this -> PCB.procType = procType;
PCB.state = "NEW";
this -> arrivalTime = arrivalTime;
this -> CPUTime = CPUTime;
this -> IOTime = IOTime;
this -> isExecuted = false;
this -> timeInReady = 0;
}
void printData() {
cout << PCB.PID << " " << PCB.PName << " " << PCB.Priority << " " << arrivalTime << " " << PCB.procType << " " << CPUTime << " " << IOTime << endl;
}
};