![]() |
SUMO - Simulation of Urban MObility
|
Interface for building edges. More...
#include <NLEdgeControlBuilder.h>
Public Member Functions | |
virtual void | addCrossingEdges (const std::vector< std::string > &) |
add the crossingEdges in a crossing edge if present More... | |
virtual MSLane * | addLane (const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel) |
Adds a lane to the current edge. More... | |
virtual void | addNeigh (const std::string id) |
Adds a neighbor to the current lane. More... | |
void | beginEdgeParsing (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority) |
Begins building of an MSEdge. More... | |
MSEdgeControl * | build () |
builds the MSEdgeControl-class which holds all edges More... | |
virtual MSEdge * | buildEdge (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority) |
Builds an edge instance (MSEdge in this case) More... | |
virtual MSEdge * | closeEdge () |
Closes the building of an edge; The edge is completely described by now and may not be opened again. More... | |
NLEdgeControlBuilder () | |
Constructor. More... | |
virtual | ~NLEdgeControlBuilder () |
Destructor. More... | |
Protected Attributes | |
MSEdge * | myActiveEdge |
pointer to the currently chosen edge More... | |
int | myCurrentNumericalEdgeID |
A running number for edge numbering. More... | |
int | myCurrentNumericalLaneID |
A running number for lane numbering. More... | |
MSEdgeVector | myEdges |
Temporary, internal storage for built edges. More... | |
std::vector< MSLane * > * | myLaneStorage |
pointer to a temporary lane storage More... | |
Private Member Functions | |
NLEdgeControlBuilder (const NLEdgeControlBuilder &s) | |
invalidated copy constructor More... | |
NLEdgeControlBuilder & | operator= (const NLEdgeControlBuilder &s) |
invalidated assignment operator More... | |
Interface for building edges.
This class is the container for MSEdge-instances while they are build.
While building instances of MSEdge, these are stored in a list. The list of edges is later split into two lists, one containing single-lane-edges and one containing multi-lane-edges.
Definition at line 63 of file NLEdgeControlBuilder.h.
NLEdgeControlBuilder::NLEdgeControlBuilder | ( | ) |
Constructor.
Definition at line 52 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, and myLaneStorage.
|
virtual |
|
private |
invalidated copy constructor
|
virtual |
add the crossingEdges in a crossing edge if present
[in] | the | vector of crossed edges id |
Definition at line 148 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, and MSEdge::setCrossingEdges().
Referenced by NLHandler::beginEdgeParsing().
|
virtual |
Adds a lane to the current edge.
[in] | id | The lane's id |
[in] | maxSpeed | The speed allowed on this lane |
[in] | length | The lane's length |
[in] | shape | The shape of the lane |
[in] | width | The width of the lane |
[in] | permissions | Encoding of vehicle classes that may drive on this lane |
[in] | index | The index of this lane within its parent edge |
Reimplemented in GUIEdgeControlBuilder.
Definition at line 81 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentNumericalLaneID, and myLaneStorage.
Referenced by NLHandler::addLane().
|
virtual |
Adds a neighbor to the current lane.
[in] | id | The lane's id |
Definition at line 92 of file NLEdgeControlBuilder.cpp.
References myLaneStorage.
Referenced by NLHandler::myStartElement().
void NLEdgeControlBuilder::beginEdgeParsing | ( | const std::string & | id, |
const SumoXMLEdgeFunc | function, | ||
const std::string & | streetName, | ||
const std::string & | edgeType, | ||
int | priority | ||
) |
Begins building of an MSEdge.
Builds an instance of MSEdge using "buildEdge". Stores it as the current edge in "myActiveEdge" and appends it to the list of built edges ("myEdges").
The given information is used to build the edge.
[in] | id | The id of the edge |
[in] | function | The function of the edge |
[in] | streetName | The street name of the edge |
InvalidArgument | If an edge with the same name was already built |
Definition at line 65 of file NLEdgeControlBuilder.cpp.
References buildEdge(), MSEdge::dictionary(), myActiveEdge, myEdges, and myLaneStorage.
Referenced by NLHandler::beginEdgeParsing().
MSEdgeControl * NLEdgeControlBuilder::build | ( | ) |
builds the MSEdgeControl-class which holds all edges
Definition at line 109 of file NLEdgeControlBuilder.cpp.
References deprecatedVehicleClassesSeen, Named::getID(), MSEdge::getNumPredecessors(), MSEdge::getNumSuccessors(), MSEdge::getPredecessors(), MSEdge::getSuccessors(), MSGlobals::gUsingInternalLanes, MSEdge::isInternal(), MSEdge::markAsRoundabout(), myEdges, toString(), and WRITE_WARNING.
Referenced by NLBuilder::buildNet().
|
virtual |
Builds an edge instance (MSEdge in this case)
Builds an MSEdge-instance using the given name and the current index "myCurrentNumericalEdgeID". Post-increments the index, returns the built edge.
[in] | id | The id of the edge to build |
[in] | streetName | The street name of the edge to build |
Reimplemented in GUIEdgeControlBuilder.
Definition at line 143 of file NLEdgeControlBuilder.cpp.
References myCurrentNumericalEdgeID.
Referenced by NLHandler::addDistrict(), and beginEdgeParsing().
|
virtual |
Closes the building of an edge; The edge is completely described by now and may not be opened again.
Definition at line 98 of file NLEdgeControlBuilder.cpp.
References MSEdge::initialize(), myActiveEdge, and myLaneStorage.
Referenced by NLHandler::closeEdge().
|
private |
invalidated assignment operator
|
protected |
pointer to the currently chosen edge
Definition at line 153 of file NLEdgeControlBuilder.h.
Referenced by addCrossingEdges(), GUIEdgeControlBuilder::addLane(), addLane(), beginEdgeParsing(), closeEdge(), and NLEdgeControlBuilder().
|
protected |
A running number for edge numbering.
Definition at line 147 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::buildEdge(), and buildEdge().
|
protected |
A running number for lane numbering.
Definition at line 144 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::addLane(), and addLane().
|
protected |
Temporary, internal storage for built edges.
Definition at line 150 of file NLEdgeControlBuilder.h.
Referenced by beginEdgeParsing(), and build().
|
protected |
pointer to a temporary lane storage
Definition at line 156 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::addLane(), addLane(), addNeigh(), beginEdgeParsing(), closeEdge(), NLEdgeControlBuilder(), and ~NLEdgeControlBuilder().