SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NLEdgeControlBuilder Class Reference

Interface for building edges. More...

#include <NLEdgeControlBuilder.h>

Inheritance diagram for NLEdgeControlBuilder:
GUIEdgeControlBuilder

Public Types

typedef std::vector< MSEdge * > EdgeCont
 definition of the used storage for edges

Public Member Functions

virtual MSLaneaddLane (const std::string &id, SUMOReal maxSpeed, SUMOReal length, const PositionVector &shape, SUMOReal width, SVCPermissions permissions)
 Adds a lane to the current edge;.
void beginEdgeParsing (const std::string &id, MSEdge::EdgeBasicFunction function, const std::string &streetName)
 Begins building of an MSEdge.
MSEdgeControlbuild ()
 builds the MSEdgeControl-class which holds all edges
virtual MSEdgebuildEdge (const std::string &id, const std::string &streetName="")
 Builds an edge instance (MSEdge in this case)
virtual MSEdgecloseEdge ()
 Closes the building of an edge; The edge is completely described by now and may not be opened again.
 NLEdgeControlBuilder ()
 Constructor.
virtual ~NLEdgeControlBuilder ()
 Destructor.

Protected Attributes

MSEdgemyActiveEdge
 pointer to the currently chosen edge
unsigned int myCurrentNumericalEdgeID
 A running number for edge numbering.
unsigned int myCurrentNumericalLaneID
 A running number for lane numbering.
EdgeCont myEdges
 Temporary, internal storage for built edges.
MSEdge::EdgeBasicFunction myFunction
 the function of the current edge
std::vector< MSLane * > * myLaneStorage
 pointer to a temporary lane storage

Private Member Functions

 NLEdgeControlBuilder (const NLEdgeControlBuilder &s)
 invalidated copy constructor
NLEdgeControlBuilderoperator= (const NLEdgeControlBuilder &s)
 invalidated assignment operator

Detailed Description

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.

Todo:
Assignment of lanes is not really well. Should be reworked after shapes are given as params.

Definition at line 64 of file NLEdgeControlBuilder.h.


Member Typedef Documentation

typedef std::vector<MSEdge*> NLEdgeControlBuilder::EdgeCont

definition of the used storage for edges

Definition at line 67 of file NLEdgeControlBuilder.h.


Constructor & Destructor Documentation

NLEdgeControlBuilder::NLEdgeControlBuilder ( )

Constructor.

Definition at line 61 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, and myLaneStorage.

NLEdgeControlBuilder::~NLEdgeControlBuilder ( )
virtual

Destructor.

Definition at line 68 of file NLEdgeControlBuilder.cpp.

References myLaneStorage.

NLEdgeControlBuilder::NLEdgeControlBuilder ( const NLEdgeControlBuilder s)
private

invalidated copy constructor


Member Function Documentation

MSLane * NLEdgeControlBuilder::addLane ( const std::string &  id,
SUMOReal  maxSpeed,
SUMOReal  length,
const PositionVector shape,
SUMOReal  width,
SVCPermissions  permissions 
)
virtual

Adds a lane to the current edge;.

This method throws an ProcessError when the lane is marked to be the depart lane and another so marked lane was added before

Parameters:
[in]idThe lane's id
[in]maxSpeedThe speed allowed on this lane
[in]lengthThe lane's length
[in]shapeThe shape of the lane
[in]widthThe width of the lane
[in]allowedVehicle classes that explicitly may drive on this lane
[in]disallowedVehicle classes that are explicitly forbidden on this lane
See also:
SUMOVehicleClass
MSLane
MSInternalLane
Todo:
Definitely not a good way

Reimplemented in GUIEdgeControlBuilder.

Definition at line 87 of file NLEdgeControlBuilder.cpp.

References MSEdge::EDGEFUNCTION_CONNECTOR, MSEdge::EDGEFUNCTION_INTERNAL, MSEdge::EDGEFUNCTION_NORMAL, myActiveEdge, myCurrentNumericalLaneID, myFunction, and myLaneStorage.

Referenced by NLHandler::addLane().

void NLEdgeControlBuilder::beginEdgeParsing ( const std::string &  id,
MSEdge::EdgeBasicFunction  function,
const std::string &  streetName 
)

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.

Parameters:
[in]idThe id of the edge
[in]functionThe function of the edge
[in]streetNameThe street name of the edge
Exceptions:
InvalidArgumentIf an edge with the same name was already built

Definition at line 74 of file NLEdgeControlBuilder.cpp.

References buildEdge(), MSEdge::dictionary(), myActiveEdge, myEdges, and myFunction.

Referenced by NLHandler::beginEdgeParsing().

MSEdgeControl * NLEdgeControlBuilder::build ( )

builds the MSEdgeControl-class which holds all edges

Definition at line 122 of file NLEdgeControlBuilder.cpp.

References OptionsCont::getOptions(), MSGlobals::gUseMesoSim, and myEdges.

Referenced by NLBuilder::buildNet().

MSEdge * NLEdgeControlBuilder::buildEdge ( const std::string &  id,
const std::string &  streetName = "" 
)
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.

Parameters:
[in]idThe id of the edge to build
[in]streetNameThe street name of the edge to build

Reimplemented in GUIEdgeControlBuilder.

Definition at line 136 of file NLEdgeControlBuilder.cpp.

References myCurrentNumericalEdgeID.

Referenced by NLHandler::addDistrict(), and beginEdgeParsing().

MSEdge * NLEdgeControlBuilder::closeEdge ( )
virtual

Closes the building of an edge; The edge is completely described by now and may not be opened again.

Reimplemented in GUIEdgeControlBuilder.

Definition at line 111 of file NLEdgeControlBuilder.cpp.

References MSEdge::initialize(), myActiveEdge, myFunction, and myLaneStorage.

Referenced by NLHandler::closeEdge().

NLEdgeControlBuilder& NLEdgeControlBuilder::operator= ( const NLEdgeControlBuilder s)
private

invalidated assignment operator


Field Documentation

MSEdge* NLEdgeControlBuilder::myActiveEdge
protected

pointer to the currently chosen edge

Definition at line 147 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), addLane(), beginEdgeParsing(), closeEdge(), and NLEdgeControlBuilder().

unsigned int NLEdgeControlBuilder::myCurrentNumericalEdgeID
protected

A running number for edge numbering.

Definition at line 141 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::buildEdge(), and buildEdge().

unsigned int NLEdgeControlBuilder::myCurrentNumericalLaneID
protected

A running number for lane numbering.

Definition at line 138 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), and addLane().

EdgeCont NLEdgeControlBuilder::myEdges
protected

Temporary, internal storage for built edges.

Definition at line 144 of file NLEdgeControlBuilder.h.

Referenced by beginEdgeParsing(), and build().

MSEdge::EdgeBasicFunction NLEdgeControlBuilder::myFunction
protected

the function of the current edge

Definition at line 153 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), addLane(), beginEdgeParsing(), and closeEdge().

std::vector<MSLane*>* NLEdgeControlBuilder::myLaneStorage
protected

pointer to a temporary lane storage

Definition at line 150 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), addLane(), closeEdge(), NLEdgeControlBuilder(), and ~NLEdgeControlBuilder().


The documentation for this class was generated from the following files: