-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (29 loc) · 843 Bytes
/
main.cpp
File metadata and controls
31 lines (29 loc) · 843 Bytes
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
29
30
31
// Tomer Shlasky 204300602
//
#include <vector>
#include "Solvers/Solver.h"
#include "Solvers/StringReverser.h"
#include "CacheManagers/CacheManager.h"
#include "CacheManagers/FileCacheManager.h"
#include "Solvers/SearchSolver.h"
#include "EmpiricalExperiment.h"
#include "Servers/MySerialServer.h"
#include "ClientHandlers/MyClientHandler.h"
#include "Controller.h"
#include <string>
int main(int argc, char *argv[]) {
int port;
if (argc != 2) {
throw runtime_error("invalid args!");
}
try {
port = stoi(argv[1]); // try convert to int
} catch (invalid_argument &ex) {
throw runtime_error("invalid port!");
}
// valid- create controller and run program
auto *controller = new Controller();
controller->runProgram(port);
delete (controller); // free controller
return 0;
}