-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.cpp
44 lines (32 loc) · 898 Bytes
/
process.cpp
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
//1115201900266
//PANAGIOTIS KONTOEIDIS
#include "process.hpp"
using namespace std;
Process::Process(){}
Process::Process(int Pid, int ar_t, int b_t, int l_t, int pr){
this->pid=Pid;
this->priority=pr;
this->arrival_time=ar_t;
this->burst_time=b_t;
this->remaining_time=burst_time;
this->lifetime = l_t;
this->running=-1;
this->blocked=-1;
this->t_priority=pr;
}
int Process::get_priority(){
return this->priority;
}
int Process::get_arr_time(){
return this->arrival_time;
}
int Process::get_burst_time(){
return this->burst_time;
}
int Process::get_rem_time(){
return this->remaining_time;
}
void Process::print_all(){
cout<<"Process pid:"<<this->pid<<" arrival time: "<<this->arrival_time<<" burst time: "<<this->burst_time;
cout<<" priority: "<<this->priority<<" lifetime "<<this->lifetime<<" state "<<this->state<<endl;
}