SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROLane.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A single lane the router may use
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef ROLane_h
22 #define ROLane_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <utils/common/Named.h>
37 #include "ROEdge.h"
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
52 class ROLane : public Named {
53 public:
61  ROLane(const std::string& id, ROEdge* edge, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions) :
62  Named(id), myEdge(edge), myLength(length), myMaxSpeed(maxSpeed), myPermissions(permissions)
63  {}
64 
65 
67  ~ROLane() { }
68 
69 
73  SUMOReal getLength() const {
74  return myLength;
75  }
76 
77 
81  SUMOReal getSpeed() const {
82  return myMaxSpeed;
83  }
84 
85 
90  return myPermissions;
91  }
92 
96  ROEdge& getEdge() const {
97  return *myEdge;
98  }
99 
101  const std::vector<const ROLane*>& getOutgoingLanes() const {
102  return myOutgoingLanes;
103  }
104 
105  void addOutgoingLane(ROLane* lane) {
106  myOutgoingLanes.push_back(lane);
107  }
108 
111  return LINKSTATE_MAJOR;
112  }
113 
114  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
115  return (myPermissions & vclass) == vclass;
116  }
117 
118 private:
121 
124 
127 
130 
131  std::vector<const ROLane*> myOutgoingLanes;
132 
133 
134 private:
136  ROLane(const ROLane& src);
137 
139  ROLane& operator=(const ROLane& src);
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147