-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStation.h
45 lines (33 loc) · 1.19 KB
/
Station.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
#ifndef STATION_H
#define STATION_H
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string.h>
#include<vector>
using namespace std;
class Station {
public:
friend class PublicTransportNetwork;
Station(const Station&) = delete;
Station& operator = (const Station&) = delete;
int getCode();
string getName();
Station* getNeighbour(string line_label);
bool BFSStationSearch(int last_code, queue<int>&visit_children, set <int>& visited_stations, map<int, pair<int, string>>& pred);
void markLines(string label, set<int>&visited_stations, set<string>&visited_lines,queue<pair<string,int>>&visit_children, map<string, pair<string, int>>& pred);
static string writePath(Station* beg,Station* end,string line);
string outputLines();
string outputStationCodeAndName();
void writeIntersection(map<pair<string,string>,int>&intersections,map<string,int>& max);
static int readCode(const string& text,int& pos);
private:
Station(const string& text,int& pos);
void readName(const string& text, int& pos);
void addNeighbour(string label,Station* neighbour);
int code_;
string name_;
map<string,Station*>neighbours_;
};
#endif