SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSJunction.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The base class for an intersection
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSJunction_h
24 #define MSJunction_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <vector>
38 #include <map>
39 #include <utils/geom/Position.h>
41 #include <utils/common/Named.h>
42 #include <utils/common/SUMOTime.h>
44 
45 
46 class MSVehicle;
47 class MSLink;
48 class MSLane;
49 class MSEdge;
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
58 class MSJunction : public Named {
59 public:
65  MSJunction(const std::string& id, const Position& position,
66  const PositionVector& shape);
67 
68 
70  virtual ~MSJunction();
71 
72 
75  virtual void postloadInit();
76 
77 
79  const Position& getPosition() const;
80 
81 
85  const PositionVector& getShape() const {
86  return myShape;
87  }
88 
89  virtual const std::vector<MSLink*>& getFoeLinks(const MSLink* const /*srcLink*/) const {
90  return myEmptyLinks;
91  }
92 
93  virtual const std::vector<MSLane*>& getFoeInternalLanes(const MSLink* const /*srcLink*/) const {
94  return myEmptyLanes;
95  }
96 
97  inline const std::vector<const MSEdge*>& getIncoming() const {
98  return myIncoming;
99  }
100 
101  inline const std::vector<const MSEdge*>& getOutgoing() const {
102  return myOutgoing;
103  }
104 
105  void addIncoming(MSEdge* edge) {
106  myIncoming.push_back(edge);
107  }
108 
109  void addOutgoing(MSEdge* edge) {
110  myOutgoing.push_back(edge);
111  }
112 
113 protected:
116 
119 
120  std::vector<MSLink*> myEmptyLinks;
121  std::vector<MSLane*> myEmptyLanes;
122 
123 
125  std::vector<const MSEdge*> myIncoming;
127  std::vector<const MSEdge*> myOutgoing;
128 
130  typedef std::map<std::string, MSJunction* > DictType;
131 
132 private:
134  MSJunction(const MSJunction&);
135 
138 
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145