-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManager.cpp
More file actions
38 lines (32 loc) · 930 Bytes
/
Copy pathManager.cpp
File metadata and controls
38 lines (32 loc) · 930 Bytes
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
#include "Manager.h"
//#include <cmath>
//using namespace std;
/*
lower_greater : guides the new process where it must be inserted
according to its BT size
1 -> from the middle of the list to the end
0 -> from the middle of the list to the front
*/
void Manager::OrderedInsert(Process pProcess, list<Process> &Queue)
{
Process *father, *son;
if(Queue.empty())
Queue.push_front(pProcess);
else
{
father = &Queue.front();
father += uint(Queue.size()/2);
bool lower_greater = pProcess.BT > father->BT;
if(lower_greater)
{
for(uint i = uint(Queue.size()/2); i > Queue.size(); i++)
{
list<Process> Queue_copy = Queue;
if (/* condition */)
{
/* code */
}
}
}
}
}