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 
SUMOReal myMaxSpeed
The maximum speed allowed on the lane.
Definition: ROLane.h:126
ROEdge & getEdge() const
Returns the lane's edge.
Definition: ROLane.h:96
A single lane the router may use.
Definition: ROLane.h:52
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
~ROLane()
Destructor.
Definition: ROLane.h:67
ROLane(const std::string &id, ROEdge *edge, SUMOReal length, SUMOReal maxSpeed, SVCPermissions permissions)
Constructor.
Definition: ROLane.h:61
SVCPermissions myPermissions
The encoding of allowed vehicle classes.
Definition: ROLane.h:129
SUMOReal getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:81
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: ROLane.h:114
std::vector< const ROLane * > myOutgoingLanes
Definition: ROLane.h:131
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
const std::vector< const ROLane * > & getOutgoingLanes() const
get the list of outgoing lanes
Definition: ROLane.h:101
A basic edge for routing applications.
Definition: ROEdge.h:69
Base class for objects which have an id.
Definition: Named.h:45
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane (ignored for routing) ...
Definition: ROLane.h:110
void addOutgoingLane(ROLane *lane)
Definition: ROLane.h:105
SUMOReal myLength
The length of the lane.
Definition: ROLane.h:123
This is an uncontrolled, major link, may pass.
SUMOReal getLength() const
Returns the length of the lane.
Definition: ROLane.h:73
#define SUMOReal
Definition: config.h:215
ROEdge * myEdge
The parent edge of this lane.
Definition: ROLane.h:120
ROLane & operator=(const ROLane &src)
Invalidated assignment operator.
SVCPermissions getPermissions()
Returns the list of allowed vehicle classes.
Definition: ROLane.h:89