blob: d601165304dff473f12f98b70f6546a3e541adae (
plain)
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
|
#include <cstdio>
#include "Exception.h"
#include "LoadFilesCommand.h"
#include "Museum.h"
#include "View.h"
using namespace std;
int main(int argc, char** argv) {
Museum museum {};
View view { museum };
try {
LoadFilesCommand(museum, argc - 1, &argv[1]).execute();
} catch (Exception & e) {
printf("%s\n", e.what());
return EXIT_FAILURE; // invalid files on start cause exit
}
// Museum and View both create their own worker threads, so the main thread
// should remain to keep the view active.
while (view.open) {
continue;
}
return EXIT_SUCCESS;
}
|