// // Created by rhetenor on 13.09.18. // #include #include #include #include #include "DriverFactory.h" #include "IInputDriver.h" #include "PrintHandler.h" using namespace FlippR_Driver; void siginthandler(int param) { printf("Caught SIGINT... aborting!\n"); exit(1); } int main (int argc, char *argv[]) { if(argc != 3) { std::cout << "Usage: " << argv[0] << " "; exit(1); } signal(SIGINT, siginthandler); std::string input_config_file = argv[1]; std::string matrix_config_file = argv[2]; std::ifstream input_config; std::ifstream matrix_config; try { input_config.open(input_config_file); matrix_config.open(matrix_config_file); } catch(const std::exception& e) { std::cout << e.what(); exit(2); } std::shared_ptr driver = FlippR_Driver::get_InputDriver(input_config, matrix_config); PrintHandler* print_handler = new PrintHandler(driver); // driver->register_event_handler(print_handler); //registriert sich eigentlich von selbst! while(1); return 0; }