-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScheduler.h
More file actions
66 lines (42 loc) · 1.11 KB
/
Scheduler.h
File metadata and controls
66 lines (42 loc) · 1.11 KB
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
62
63
64
65
66
//
// Created by ben on 8/4/19.
//
#ifndef IOSCHEDULER_SCHEDULER_H
#define IOSCHEDULER_SCHEDULER_H
#include "IO_Request.h"
#include <list>
using namespace std;
class Scheduler {
public:
list <IO_Request *> IO_ready_queue;
list <IO_Request *> IO_add_queue;
int which_queue;
IO_Request *active_request;
int CURRENT_TRACK;
int head_direction;
bool change_direction;
bool q_option;
virtual IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue) = 0;
Scheduler();
};
class FIFO : public Scheduler {
public:
IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue);
};
class SSTF : public Scheduler{
public:
IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue);
};
class LOOK : public Scheduler{
public:
IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue) ;
};
class CLOOK : public Scheduler{
public:
IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue) ;
};
class FLOOK : public Scheduler{
public:
IO_Request* get_next_request(list <IO_Request *> &IO_ready_queue) ;
};
#endif //IOSCHEDULER_SCHEDULER_H