-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEr.h
67 lines (45 loc) · 1.37 KB
/
Er.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// Created by lutfullah on 04.05.2022.
//
#ifndef ODTU_OS_ODEV_2_ER_H
#define ODTU_OS_ODEV_2_ER_H
#include "hw2_output.h"
#include <iostream>
#include <utility>
#include <pthread.h>
#include <vector>
struct Mintika;
struct MintikaHucresi;
class Emir;
struct Er;
timespec timespec_add_ms(timespec ts1, int ms);
struct Kapsam {
Kapsam(int strSayisi, int stnSayisi, const std::pair<int, int> &solUstKoordinat);
MintikaHucresi & mintikaHucresiGetir(std::vector<std::vector<MintikaHucresi>> &mintika, int i, int j);
int strSayisi;
int stnSayisi;
std::pair<int, int> solUstKoordinat;
void temizlikcileriAyarla(Mintika &mintika, Er *erPtr);
void iVeJYeKadarKilitAc(int i, int j, std::vector<std::vector<MintikaHucresi>> &mintika);
};
/**
* Proper Private
*/
struct Er {
int gid;
int toplamaSuresiMs;
std::vector<Kapsam> kapsamlar;
Mintika &mintika;
Er(int gid, int toplamaSuresiMs, std::vector<Kapsam> &kapsamlar, Mintika &mintika);
~Er();
void kapsamRezerveEt(Kapsam &kapsam);
bool izmaritTopla(Kapsam &kapsam);
void rezervasyonuBitir(Kapsam &kapsam);
bool molada;
void emirVarsaUy();
timespec toplamaZamaniHesapla();
bool molaysaRezervasyonBitirGerekirseDur(Kapsam &kapsam);
void moladaDegilseMolayaAlVeNotifyYap();
void moladaysaMoladanCikarVeNotifyYap();
};
#endif //ODTU_OS_ODEV_2_ER_H