SUMO - Simulation of Urban MObility
GNEClosingReroute.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 "GNEClosingReroute.h"
33 #include "GNEEdge.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 GNEClosingReroute::GNEClosingReroute(GNERerouterInterval& rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions allowedVehicles, SVCPermissions disallowedVehicles) :
44  myRerouterIntervalParent(&rerouterIntervalParent),
45  myClosedEdge(closedEdge),
46  myAllowedVehicles(allowedVehicles),
47  myDisallowedVehicles(disallowedVehicles),
49 }
50 
51 
53 }
54 
55 
58  return myAllowedVehicles;
59 }
60 
61 
64  return myDisallowedVehicles;
65 }
66 
67 
68 void
70  myAllowedVehicles = allowed;
71 }
72 
73 
74 void
76  myDisallowedVehicles = disallowed;
77 }
78 
79 
80 GNEEdge*
82  return myClosedEdge;
83 }
84 
85 
86 void
88  myClosedEdge = edge;
89 }
90 
91 
94  return myTag;
95 }
96 
97 
100  return *myRerouterIntervalParent;
101 }
102 
103 
104 bool
106  if ((myRerouterIntervalParent == closingReroute.myRerouterIntervalParent) &&
107  (myClosedEdge == closingReroute.myClosedEdge) &&
108  (myAllowedVehicles == closingReroute.myAllowedVehicles) &&
109  (myDisallowedVehicles == closingReroute.myDisallowedVehicles)) {
110  return true;
111  } else {
112  return false;
113  }
114 }
115 
116 /****************************************************************************/
SumoXMLTag
Numbers representing SUMO-XML - element names.
int SVCPermissions
SVCPermissions myAllowedVehicles
codified allowed vehicles
SVCPermissions myDisallowedVehicles
codified disallowed vehicles
GNERerouterInterval * myRerouterIntervalParent
reference to rerouter interval parent
GNEEdge * getClosedEdge() const
get closed edge
SumoXMLTag getTag() const
get tag
SumoXMLTag myTag
XML Tag of closing reroute.
const GNERerouterInterval & getRerouterIntervalParent() const
get rerouter interval parent
void setClosedEdge(GNEEdge *edge)
set closed edge
~GNEClosingReroute()
destructor
GNEClosingReroute(GNERerouterInterval &rerouterIntervalParent, GNEEdge *closedEdge, SVCPermissions allowedVehicles=SVC_IGNORING, SVCPermissions disallowedVehicles=SVC_IGNORING)
constructor
GNEEdge * myClosedEdge
closed edge
SVCPermissions getDisallowedVehicles() const
get disallowed vehicles
reroute of type closing
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
SVCPermissions getAllowedVehicles() const
get allowed vehicles
void setDisallowedVehicles(SVCPermissions disallowed)
set disallowed vehicles
void setAllowedVehicles(SVCPermissions allowed)
set allowed vehicles
bool operator==(const GNEClosingReroute &closingReroute)
overload operator ==