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 #ifdef CHECK_MEMORY_LEAKS
36 #include <foreign/nvwa/debug_new.h>
37 #endif
38 
39 // ===========================================================================
40 // member method definitions
41 // ===========================================================================
42 
43 GNEClosingLaneReroute::GNEClosingLaneReroute(GNERerouterInterval& rerouterIntervalParent, GNELane* closedLane, SVCPermissions allowedVehicles, SVCPermissions disallowedVehicles) :
44  myRerouterIntervalParent(&rerouterIntervalParent),
45  myClosedLane(closedLane),
46  myAllowedVehicles(allowedVehicles),
47  myDisallowedVehicles(disallowedVehicles),
49 }
50 
51 
53 }
54 
57  return myAllowedVehicles;
58 }
59 
60 
63  return myDisallowedVehicles;
64 }
65 
66 
67 void
69  myAllowedVehicles = allowed;
70 }
71 
72 
73 void
75  myDisallowedVehicles = disallowed;
76 }
77 
78 
79 GNELane*
81  return myClosedLane;
82 }
83 
84 
85 void
87  myClosedLane = lane;
88 }
89 
90 
93  return myTag;
94 }
95 
96 
100 }
101 
102 
103 bool
105  if ((myRerouterIntervalParent == closingReroute.myRerouterIntervalParent) &&
106  (myClosedLane == closingReroute.myClosedLane) &&
107  (myAllowedVehicles == closingReroute.myAllowedVehicles) &&
108  (myDisallowedVehicles == closingReroute.myDisallowedVehicles)) {
109  return true;
110  } else {
111  return false;
112  }
113 }
114 /****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
SVCPermissions myDisallowedVehicles
codified disallowed vehicles
lane of a reroute of type closing
int SVCPermissions
GNELane * getClosedLane() const
get closed lane Id
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
SVCPermissions getDisallowedVehicles() const
get disallowed vehicles
void setClosedLane(GNELane *lane)
set closed lane Id
void setAllowedVehicles(SVCPermissions allowed)
set allowed vehicles
const GNERerouterInterval & getRerouterIntervalParent() const
get rerouter interval parent
SVCPermissions myAllowedVehicles
codified allowed vehicles
GNELane * myClosedLane
closed lane
SumoXMLTag myTag
XML Tag of closing lane reroute.
bool operator==(const GNEClosingLaneReroute &closingLaneReroute)
overload operator ==
void setDisallowedVehicles(SVCPermissions disallowed)
set disallowed vehicles
GNEClosingLaneReroute(GNERerouterInterval &rerouterIntervalParent, GNELane *closedLane, SVCPermissions allowedVehicles=SVC_IGNORING, SVCPermissions disallowedVehicles=SVC_IGNORING)
constructor
SVCPermissions getAllowedVehicles() const
get allowed vehicles
SumoXMLTag getTag() const
get tag
GNERerouterInterval * myRerouterIntervalParent
reference to rerouter interval parent