aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
blob: 94cccfea9ee0303c048cbc95435afd45b49b9e82 (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
#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;
}