-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule.h
54 lines (44 loc) · 1.1 KB
/
schedule.h
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
45
46
47
48
49
50
51
52
53
54
/*
* schedule.h
*
* Created on: Nov 26, 2015
* Author: jose
*/
#ifndef SCHEDULE_H_
#define SCHEDULE_H_
#define CONFIG_FILE "schedule.conf"
#define NUM_OF_LINES 6
#include <iostream>
#include <fstream>
#include <vector>
#include <tuple>
#include "main_station.h"
#include "public_train_generator.h"
#include "adjacent_station.h"
class CSchedule
{
public:
typedef struct STrainProcess
{
std::string name;
std::string from;
std::string through;
std::string to;
unsigned int appears;
unsigned int disappears;
unsigned int comes;
unsigned int leaves;
unsigned int late;
}STrainProcess;
CSchedule();
virtual ~CSchedule();
bool OpenConfigFile(std::string file = CONFIG_FILE);
bool ParseAndPlan(CMainStation& mainStation);
bool GetLink(STrainProcess& unit);
private:
bool ParseLine(std::string line, unsigned int counter, STrainProcess& conf_struct);
typedef std::tuple<size_t, std::string> SAdjStationsTuple;
std::ifstream m_ConfigFile;
std::vector<STrainProcess> m_Configuration;
};
#endif /* SCHEDULE_H_ */