blob: 9cc8ee8096e195463a84202ae1c48dc37ecc4050 (
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
|
#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).execute(argc - 1, &argv[1]);
} 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)
;
return EXIT_SUCCESS;
}
|