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

Temporary storage for a lanes succeeding lanes while parsing them. More...

#include <NLSucceedingLaneBuilder.h>

Public Member Functions

void addSuccLane (const std::string &laneId, LinkDirection dir, LinkState state, const std::string &tlid="", unsigned int linkNo=0) throw (InvalidArgument)
 Adds a succeeding lane.
void closeSuccLane () throw (InvalidArgument)
 Ends the computation of a container holding the succeeding lanes of a lane.
const std::string & getCurrentLaneName () const
 Returns the name of the lane the succeeding lanes are added to.
 NLSucceedingLaneBuilder (NLJunctionControlBuilder &jb)
 Constructor.
void openSuccLane (const std::string &laneId)
 Begins the computation of a container holding the succeeding lanes of a lane.
 ~NLSucceedingLaneBuilder ()
 Destructor.

Private Member Functions

 NLSucceedingLaneBuilder (const NLSucceedingLaneBuilder &s)
 invalid copy constructor
NLSucceedingLaneBuilderoperator= (const NLSucceedingLaneBuilder &s)
 invalid assignment operator

Private Attributes

std::string myCurrentLane
 ID of the lane the succeeding lanes are added to.
NLJunctionControlBuildermyJunctionControlBuilder
 The junction control builder to obtain referenced tls from.
MSLinkContmySuccLanes
 The list of connections.

Detailed Description

Temporary storage for a lanes succeeding lanes while parsing them.

Todo:
Consider moving this functionality to another class

Definition at line 54 of file NLSucceedingLaneBuilder.h.


Constructor & Destructor Documentation

NLSucceedingLaneBuilder::NLSucceedingLaneBuilder ( NLJunctionControlBuilder jb)

Constructor.

Parameters:
[in]jbThe junction control builder to obtain referenced tls from

Definition at line 58 of file NLSucceedingLaneBuilder.cpp.

References mySuccLanes.

NLSucceedingLaneBuilder::~NLSucceedingLaneBuilder ( )

Destructor.

Definition at line 65 of file NLSucceedingLaneBuilder.cpp.

References mySuccLanes.

NLSucceedingLaneBuilder::NLSucceedingLaneBuilder ( const NLSucceedingLaneBuilder s)
private

invalid copy constructor


Member Function Documentation

void NLSucceedingLaneBuilder::addSuccLane ( const std::string &  laneId,
LinkDirection  dir,
LinkState  state,
const std::string &  tlid = "",
unsigned int  linkNo = 0 
) throw (InvalidArgument)

Adds a succeeding lane.

If either the current, or the succeeding lane is not known, an InvalidArgument is thrown (with the proper message). Also if a tls-logic is referenced, but not known to the junction control builder, an InvalidArgument is thrown.

Parameters:
[in]laneIdID of the lane to add a connection to (from the last opened lane)
[in]viaIDThe junction-internal lane to use to reach the destination lane
[in]passTheoretically: the maximum filling rate at the internal link; unused currently
[in]dirThe abstract direction of the link
[in]stateThe abstract state of the link
[in]tlid(optional) ID of the tls that controls the link
[in]linkNo(optional) index of the link within the controlling tls
Todo:
Recheck usage of "pass"
Exceptions:
InvalidArgumentIf one of the referenced structures was not found or is invalid
See also:
LinkDirection
LinkState
MSLink

Definition at line 77 of file NLSucceedingLaneBuilder.cpp.

References MSLane::addApproachingLane(), MSLane::addIncomingLane(), MSTLLogicControl::TLSLogicVariants::addLink(), MSLane::dictionary(), MSLane::getLength(), MSLane::getShape(), MSGlobals::gUsingInternalLanes, LINKDIR_NODIR, LINKSTATE_DEADEND, and SUMOReal.

Referenced by NLHandler::addSuccLane().

void NLSucceedingLaneBuilder::closeSuccLane ( ) throw (InvalidArgument)

Ends the computation of a container holding the succeeding lanes of a lane.

The current lane is determined and the parsed connections are added to it. If the lane is not known, an InvalidArgument is thrown.

Exceptions:
InvalidArgumentIf the current lane is not known

Definition at line 170 of file NLSucceedingLaneBuilder.cpp.

References MSLane::dictionary(), MSLane::initialize(), myCurrentLane, and mySuccLanes.

Referenced by NLHandler::closeSuccLane().

const std::string & NLSucceedingLaneBuilder::getCurrentLaneName ( ) const

Returns the name of the lane the succeeding lanes are added to.

Returns:
The ID of the currently opened lane

Definition at line 184 of file NLSucceedingLaneBuilder.cpp.

References myCurrentLane.

void NLSucceedingLaneBuilder::openSuccLane ( const std::string &  laneId)

Begins the computation of a container holding the succeeding lanes of a lane.

Parameters:
[in]laneIdThe id of the lane from which connections will be built
Todo:
Why is the ID kept, not already the lane itself?

Definition at line 71 of file NLSucceedingLaneBuilder.cpp.

References myCurrentLane.

Referenced by NLHandler::openSucc().

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

invalid assignment operator


Field Documentation

std::string NLSucceedingLaneBuilder::myCurrentLane
private

ID of the lane the succeeding lanes are added to.

Todo:
Why is not the lane itself saved?

Definition at line 121 of file NLSucceedingLaneBuilder.h.

Referenced by closeSuccLane(), getCurrentLaneName(), and openSuccLane().

NLJunctionControlBuilder& NLSucceedingLaneBuilder::myJunctionControlBuilder
private

The junction control builder to obtain referenced tls from.

Definition at line 128 of file NLSucceedingLaneBuilder.h.

MSLinkCont* NLSucceedingLaneBuilder::mySuccLanes
private

The list of connections.

Todo:
Is it really necessary to have this as a pointer - the link container is rebuilt anyway

Definition at line 125 of file NLSucceedingLaneBuilder.h.

Referenced by closeSuccLane(), NLSucceedingLaneBuilder(), and ~NLSucceedingLaneBuilder().


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