-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutility.h
32 lines (30 loc) · 1.37 KB
/
utility.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
/* FILENAME: utility.h
* AUTHOR: Ricardo J. Cantarero
* DATE: 11/13/2022
*
* Header File for utility.cpp
*/
#ifndef UTILITY_H
#define UTILITY_H
#include "process.h"
#include <algorithm> //Used for the sort algorithm to sort for Shortest Job First
#include <array> //Used to return array info
#include <vector> //Used as DS for TaskQueue/ReadyQueue, ProcessesQueue/Vector
bool process_bt_comp(process const &lhs,
process const &rhs); // method that compares vectors based
// on burstTime for SJF
bool process_at_comp(process const &lhs,
process const &rhs); // Method that compares vectors based
// on Arrivaltime for FCFS
bool queueDone(std::vector<process> &taskQueueRef); // method that informs that
// the taskQueue is empty.
void addToTaskQueue(std::vector<process> &taskQueueRef,
std::vector<process> &processVectorRef, int &clock,
bool &verbose); // Method to add to taskqueue
process *loadFirstProcess(
std::vector<process> &taskQueueRef,
bool &verbose); // Load the first processes (looks at arrival time)
process *loadShortestProcess(
std::vector<process> &taskQueueRef,
bool &verbose); // Load the shortest process (look at burst time)
#endif