SUMO - Simulation of Urban MObility
GNEClosingLaneReroute.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include <utils/common/ToString.h>
31 
32 #include "GNEClosingLaneReroute.h"
33 #include "GNELane.h"
34 
35 
36 // ===========================================================================
37 // member method definitions
38 // ===========================================================================
39 
40 GNEClosingLaneReroute::GNEClosingLaneReroute(GNERerouterInterval& rerouterIntervalParent, GNELane* closedLane, SVCPermissions allowedVehicles, SVCPermissions disallowedVehicles) :
41  myRerouterIntervalParent(&rerouterIntervalParent),
42  myClosedLane(closedLane),
43  myAllowedVehicles(allowedVehicles),
44  myDisallowedVehicles(disallowedVehicles),
46 }
47 
48 
50 }
51 
54  return myAllowedVehicles;
55 }
56 
57 
60  return myDisallowedVehicles;
61 }
62 
63 
64 void
66  myAllowedVehicles = allowed;
67 }
68 
69 
70 void
72  myDisallowedVehicles = disallowed;
73 }
74 
75 
76 GNELane*
78  return myClosedLane;
79 }
80 
81 
82 void
84  myClosedLane = lane;
85 }
86 
87 
90  return myTag;
91 }
92 
93 
97 }
98 
99 
100 bool
102  if ((myRerouterIntervalParent == closingReroute.myRerouterIntervalParent) &&
103  (myClosedLane == closingReroute.myClosedLane) &&
104  (myAllowedVehicles == closingReroute.myAllowedVehicles) &&
105  (myDisallowedVehicles == closingReroute.myDisallowedVehicles)) {
106  return true;
107  } else {
108  return false;
109  }
110 }
111 /****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
SVCPermissions myDisallowedVehicles
codified disallowed vehicles
SumoXMLTag getTag() const
get tag
SVCPermissions getDisallowedVehicles() const
get disallowed vehicles
lane of a reroute of type closing
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
void setClosedLane(GNELane *lane)
set closed lane Id
SVCPermissions getAllowedVehicles() const
get allowed vehicles
void setAllowedVehicles(SVCPermissions allowed)
set allowed vehicles
SVCPermissions myAllowedVehicles
codified allowed vehicles
bool operator==(const GNEClosingLaneReroute &closingLaneReroute) const
overload operator ==
GNELane * myClosedLane
closed lane
SumoXMLTag myTag
XML Tag of closing lane reroute.
void setDisallowedVehicles(SVCPermissions disallowed)
set disallowed vehicles
GNEClosingLaneReroute(GNERerouterInterval &rerouterIntervalParent, GNELane *closedLane, SVCPermissions allowedVehicles=SVC_IGNORING, SVCPermissions disallowedVehicles=SVC_IGNORING)
constructor
GNELane * getClosedLane() const
get closed lane Id
GNERerouterInterval * myRerouterIntervalParent
reference to rerouter interval parent
const GNERerouterInterval & getRerouterIntervalParent() const
get rerouter interval parent