SUMO - Simulation of Urban MObility
NBPTLine.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The representation of one direction of a single pt line
19 /****************************************************************************/
20 #ifndef SUMO_NBPTLINE_H
21 #define SUMO_NBPTLINE_H
22 
23 
24 #include <string>
25 #include <vector>
26 #include <map>
27 #include "NBEdge.h" // Cherednychek
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class OutputDevice;
33 class NBPTStop;
34 class NBEdgeCont;
35 
36 class NBPTLine {
37 
38 public:
39  explicit NBPTLine(const std::string& name, const std::string& type);
40 
41  void addPTStop(NBPTStop* pStop);
42  long long int getLineID() const;
43  const std::string& getName() const ;
44  std::vector<NBPTStop*> getStops();
45  void write(OutputDevice& device, NBEdgeCont& ec);
46  void setId(long long int id);
47  void addWayNode(long long int way, long long int node);
48  void setRef(std::string basic_string);
49 
50  void setMyNumOfStops(int numStops);
51 private:
52  std::string myName;
53  std::string myType;
54  std::vector<NBPTStop*> myPTStops;
55 
56 private:
57  std::map<std::string, std::vector<long long int> > myWaysNodes;
58  std::vector<std::string> myWays;
59 public:
60  const std::vector<std::string>& getMyWays() const;
61  std::vector<long long int>* getWaysNodes(std::string wayId);
62 private:
63 
64  std::string myCurrentWay;
65  long long int myPTLineId;
66  std::string myRef;
67 
68 public:
69  void addEdgeVector(std::vector<NBEdge*>::iterator fr, std::vector<NBEdge*>::iterator to);
70 private:
71  // route of ptline
72  std::vector<NBEdge*> myRoute;
73 public:
74  const std::vector<NBEdge*>& getRoute() const;
75 private:
76 
78 };
79 
80 
81 #endif //SUMO_NBPTLINE_H
std::vector< long long int > * getWaysNodes(std::string wayId)
Definition: NBPTLine.cpp:105
void write(OutputDevice &device, NBEdgeCont &ec)
Definition: NBPTLine.cpp:52
std::string myRef
Definition: NBPTLine.h:66
std::vector< std::string > myWays
Definition: NBPTLine.h:58
std::vector< NBPTStop * > myPTStops
Definition: NBPTLine.h:54
void addPTStop(NBPTStop *pStop)
Definition: NBPTLine.cpp:36
std::string myType
Definition: NBPTLine.h:53
The representation of a single pt stop.
Definition: NBPTStop.h:51
const std::vector< std::string > & getMyWays() const
Definition: NBPTLine.cpp:102
NBPTLine(const std::string &name, const std::string &type)
Definition: NBPTLine.cpp:29
const std::vector< NBEdge * > & getRoute() const
Definition: NBPTLine.cpp:122
void addWayNode(long long int way, long long int node)
Definition: NBPTLine.cpp:93
void setMyNumOfStops(int numStops)
Definition: NBPTLine.cpp:119
void setRef(std::string basic_string)
Definition: NBPTLine.cpp:111
void addEdgeVector(std::vector< NBEdge *>::iterator fr, std::vector< NBEdge *>::iterator to)
Definition: NBPTLine.cpp:115
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
long long int myPTLineId
Definition: NBPTLine.h:65
std::string myName
Definition: NBPTLine.h:52
std::string myCurrentWay
Definition: NBPTLine.h:64
const std::string & getName() const
Definition: NBPTLine.cpp:40
std::vector< NBEdge * > myRoute
Definition: NBPTLine.h:72
std::map< std::string, std::vector< long long int > > myWaysNodes
Definition: NBPTLine.h:57
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
std::vector< NBPTStop * > getStops()
Definition: NBPTLine.cpp:49
long long int getLineID() const
Definition: NBPTLine.cpp:45
void setId(long long int id)
Definition: NBPTLine.cpp:90
int myNumOfStops
Definition: NBPTLine.h:77