Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The representation of one direction of a single pt line
17 /****************************************************************************/
18 #ifndef SUMO_NBPTLINE_H
19 #define SUMO_NBPTLINE_H
20 
21 
22 #include <string>
23 #include <vector>
24 #include <map>
25 #include "NBEdge.h" // Cherednychek
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 class OutputDevice;
31 class NBPTStop;
32 class NBEdgeCont;
33 
34 class NBPTLine {
35 
36 public:
37  explicit NBPTLine(const std::string& id, const std::string& name,
38  const std::string& type, const std::string& ref, int interval, const std::string& nightService);
39 
40  void addPTStop(NBPTStop* pStop);
41 
42  const std::string& getLineID() const {
43  return myPTLineId;
44  }
45 
46  const std::string& getName() const {
47  return myName;
48  }
49 
50  const std::string& getType() const {
51  return myType;
52  }
53 
54  std::vector<NBPTStop*> getStops();
55  void write(OutputDevice& device, NBEdgeCont& ec);
56  void addWayNode(long long int way, long long int node);
57 
58  void setMyNumOfStops(int numStops);
59 
61  const std::string& getRef() const {
62  return myRef;
63  }
64 
65  void replaceStops(std::vector<NBPTStop*> stops) {
66  myPTStops = stops;
67  }
68 
69 private:
70  std::string myName;
71  std::string myType;
72  std::vector<NBPTStop*> myPTStops;
73 
74 private:
75  std::map<std::string, std::vector<long long int> > myWaysNodes;
76  std::vector<std::string> myWays;
77 public:
78  const std::vector<std::string>& getMyWays() const;
79  std::vector<long long int>* getWaysNodes(std::string wayId);
80 private:
81 
82  std::string myCurrentWay;
83  std::string myPTLineId;
84  std::string myRef;
86  std::string myNightService;
87 
88 public:
89  void addEdgeVector(std::vector<NBEdge*>::iterator fr, std::vector<NBEdge*>::iterator to);
90 private:
91  // route of ptline
92  std::vector<NBEdge*> myRoute;
93 public:
94  const std::vector<NBEdge*>& getRoute() const;
95 private:
96 
98 };
99 
100 
101 #endif //SUMO_NBPTLINE_H
NBPTLine::getName
const std::string & getName() const
Definition: NBPTLine.h:46
NBPTLine::myRoute
std::vector< NBEdge * > myRoute
Definition: NBPTLine.h:92
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
NBPTLine::getStops
std::vector< NBPTStop * > getStops()
Definition: NBPTLine.cpp:41
NBPTLine
Definition: NBPTLine.h:34
NBPTLine::myInterval
int myInterval
Definition: NBPTLine.h:85
NBPTLine::getType
const std::string & getType() const
Definition: NBPTLine.h:50
NBPTLine::getWaysNodes
std::vector< long long int > * getWaysNodes(std::string wayId)
Definition: NBPTLine.cpp:102
NBPTLine::myName
std::string myName
Definition: NBPTLine.h:70
NBPTLine::myPTStops
std::vector< NBPTStop * > myPTStops
Definition: NBPTLine.h:72
NBPTLine::setMyNumOfStops
void setMyNumOfStops(int numStops)
Definition: NBPTLine.cpp:113
NBPTLine::myNightService
std::string myNightService
Definition: NBPTLine.h:86
NBPTLine::getLineID
const std::string & getLineID() const
Definition: NBPTLine.h:42
NBPTLine::write
void write(OutputDevice &device, NBEdgeCont &ec)
Definition: NBPTLine.cpp:44
NBPTLine::NBPTLine
NBPTLine(const std::string &id, const std::string &name, const std::string &type, const std::string &ref, int interval, const std::string &nightService)
Definition: NBPTLine.cpp:27
NBPTLine::replaceStops
void replaceStops(std::vector< NBPTStop * > stops)
Definition: NBPTLine.h:65
NBPTLine::myWays
std::vector< std::string > myWays
Definition: NBPTLine.h:76
NBPTLine::myCurrentWay
std::string myCurrentWay
Definition: NBPTLine.h:82
NBPTLine::myType
std::string myType
Definition: NBPTLine.h:71
NBPTLine::addPTStop
void addPTStop(NBPTStop *pStop)
Definition: NBPTLine.cpp:36
NBPTLine::myRef
std::string myRef
Definition: NBPTLine.h:84
NBPTLine::getRoute
const std::vector< NBEdge * > & getRoute() const
Definition: NBPTLine.cpp:116
NBPTLine::myWaysNodes
std::map< std::string, std::vector< long long int > > myWaysNodes
Definition: NBPTLine.h:75
NBPTLine::getMyWays
const std::vector< std::string > & getMyWays() const
Definition: NBPTLine.cpp:99
NBPTLine::getRef
const std::string & getRef() const
get line reference (not unique)
Definition: NBPTLine.h:61
NBPTLine::addEdgeVector
void addEdgeVector(std::vector< NBEdge * >::iterator fr, std::vector< NBEdge * >::iterator to)
Definition: NBPTLine.cpp:109
NBPTLine::addWayNode
void addWayNode(long long int way, long long int node)
Definition: NBPTLine.cpp:90
NBPTStop
The representation of a single pt stop.
Definition: NBPTStop.h:45
NBPTLine::myPTLineId
std::string myPTLineId
Definition: NBPTLine.h:83
NBEdge.h
NBPTLine::myNumOfStops
int myNumOfStops
Definition: NBPTLine.h:97