// // Created by rhetenor on 13.09.18. // #include #include #include #include #include #include "DriverFactory.h" #include "input/InputDriver.h" #include "PrintHandler.h" using namespace flippR_driver; void siginthandler(int param) { printf("Caught SIGINT... aborting!\n"); exit(EXIT_SUCCESS); } static void show_usage(const std::string &name) { std::cout << "Usage: " << name << " [-ipc= -imc=] " << "[-opc= -odc= -olc=] " << "-osolc= -osc=]"; } PrintHandler* start_print_handler(const std::string &input_config_file, const std::string &matrix_config_file) { 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(EXIT_FAILURE); } std::shared_ptr driver = flippR_driver::get_InputDriver(input_config, matrix_config); return new PrintHandler(driver); } int main (int argc, char *argv[]) { if(argc < 3) { show_usage(argv[0]); exit(EXIT_FAILURE); } // registering sigint signal(SIGINT, siginthandler); std::string input_config_file = argv[1]; std::string matrix_config_file = argv[2]; while(1); return 0; }