-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
42 lines (34 loc) · 803 Bytes
/
window.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
#ifndef WINDOW_H
#define WINDOW_H
#include "Queue.h"
#include <QMutex>
#include <QWaitCondition>
#include <QThread>
#include <chrono>
#include <QLabel>
class Window : public QThread
{
Q_OBJECT
public:
Window(Order orderType, Queue& queue, QMutex* mutex, QLabel* customerLabel, QLabel* windowLabel);
void run() override;
void stop_serving();
Order get_order() const;
int getID() const;
QLabel* getWindowLabel() const;
void disable();
signals:
void customerVisibleChanged(bool visible, QLabel* customerLabel);
private:
static int nextID;
int ID;
Order orderType;
Queue& queue;
bool running;
bool disabled;
QMutex* mutex;
QWaitCondition conditionVariable;
QLabel* customerLabel;
QLabel* windowLabel;
};
#endif // WINDOW_H