-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
44 lines (42 loc) · 1019 Bytes
/
Main.cpp
File metadata and controls
44 lines (42 loc) · 1019 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
32
33
34
35
36
37
38
39
40
41
42
43
44
/*****************************************
- Quang Tran PSID: 1290921
- COSC 3360 Spring 2017
- Assignment 3 - PTHREAD program
*****************************************/
#include "Controller.h"
#include "InputList.h"
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
string weight; string data;
Controller controller;
int maxWeight;
weight = "";
maxWeight = 0;
InputList *list = new InputList();
if (argc > 1)
{
stringstream ss(argv[1]);
getline(ss, weight);
maxWeight = stoi(weight.c_str());
controller = Controller(maxWeight);
// controller.readFile();
// controller.execute();
}
else
cout << "No max weight of bridge to be read!";
while (getline(cin, data))
{
stringstream ss(data);
string vehicle;
int aTime, load, cTime;
ss >> vehicle >> aTime >> load >> cTime;
controller.storeFile(vehicle, aTime, load, cTime);
}
controller.execute();
// system("pause");
return 0;
}