-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewer.cpp
More file actions
30 lines (25 loc) · 714 Bytes
/
Copy pathviewer.cpp
File metadata and controls
30 lines (25 loc) · 714 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
#include <QApplication>
#include <iostream>
#include <string>
#include <thread>
#include "viewer.h"
#include "client.h"
void runApplication(int argc, char *argv[], Notifier* notifier) {
QApplication app(argc, argv);
Field field(notifier);
app.exec();
}
void runViewer(Notifier* notifier, int port) {
Viewer viewer(ActionManager(), notifier);
viewer.run(port);
}
int main(int argc, char *argv[]) {
assert(argc == 2);
int port = std::atoi(argv[1]);
Notifier notifier;
std::thread viewer_runner(runViewer, ¬ifier, port);
std::thread application_runner(runApplication, argc, argv, ¬ifier);
viewer_runner.join();
application_runner.join();
return 0;
}