Re-did the Interface::Memory* classes, added MemoryAddress.
[aesalon.git] / src / Aesalon.cpp
blobf9507a29fd5c34172118a675727618efc782f543
1 #include <iostream>
2 #include "misc/ArgumentParser.h"
3 #include "misc/ReferenceCounter.h"
4 #include "misc/EventQueue.h"
6 int main(int argc, char *argv[]) {
7 new Aesalon::Misc::ReferenceCounter();
8 new Aesalon::Misc::EventQueue();
9 Aesalon::Misc::ArgumentParser *ap = new Aesalon::Misc::ArgumentParser();
11 ap->add_argument("display interface", new Aesalon::Misc::StringArgument("--interface", 'I', "stdout"));
12 ap->add_argument("usage", new Aesalon::Misc::BooleanArgument("--usage", 'h', "", 0, false));
13 ap->add_argument("aesalon library path", new Aesalon::Misc::StringArgument("--aesalon-library-path", 0, "./libaesalon_overload.so"));
15 try {
16 Aesalon::Misc::ArgumentParser::get_instance()->parse_argv(argv);
18 catch(Aesalon::Misc::UnknownArgumentException e) {
19 std::cout << e.get_message() << std::endl;
21 try {
23 catch(Aesalon::Misc::Exception e) {
24 std::cout << "Exception caught: " << e.get_message() << std::endl;
27 /* The above call will begin the whole process, so clean up afterwards. */
29 delete Aesalon::Misc::ArgumentParser::get_instance();
30 delete Aesalon::Misc::ReferenceCounter::get_instance();
31 return 0;