SUMO - Simulation of Urban MObility
NBConnection Class Reference

#include <NBConnection.h>

Collaboration diagram for NBConnection:
Collaboration graph

Public Member Functions

bool check (const NBEdgeCont &ec)
 checks whether the edges are still valid More...
 
NBEdgegetFrom () const
 returns the from-edge (start of the connection) More...
 
int getFromLane () const
 returns the from-lane More...
 
std::string getID () const
 returns the id of the connection (!!! not really pretty) More...
 
int getTLIndex () const
 returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled More...
 
NBEdgegetTo () const
 returns the to-edge (end of the connection) More...
 
int getToLane () const
 returns the to-lane More...
 
 NBConnection (NBEdge *from, NBEdge *to)
 Constructor. More...
 
 NBConnection (NBEdge *from, int fromLane, NBEdge *to, int toLane, int tlIndex=InvalidTlIndex)
 Constructor. More...
 
 NBConnection (const std::string &fromID, NBEdge *from, const std::string &toID, NBEdge *to)
 Constructor. More...
 
 NBConnection (const NBConnection &c)
 Constructor. More...
 
bool operator!= (const NBConnection &c) const
 Comparison operator. More...
 
bool operator== (const NBConnection &c) const
 Comparison operator. More...
 
bool replaceFrom (NBEdge *which, NBEdge *by)
 replaces the from-edge by the one given More...
 
bool replaceFrom (NBEdge *which, int whichLane, NBEdge *by, int byLane)
 replaces the from-edge by the one given More...
 
bool replaceTo (NBEdge *which, NBEdge *by)
 replaces the to-edge by the one given More...
 
bool replaceTo (NBEdge *which, int whichLane, NBEdge *by, int byLane)
 replaces the to-edge by the one given More...
 
void setTLIndex (int tlIndex)
 
void shiftLaneIndex (NBEdge *edge, int offset)
 patches lane indices refering to the given edge More...
 
virtual ~NBConnection ()
 Destructor. More...
 

Static Public Attributes

static const NBConnection InvalidConnection
 
static const int InvalidTlIndex = -1
 

Private Member Functions

NBEdgecheckFrom (const NBEdgeCont &ec)
 Checks whether the from-edge is still valid. More...
 
NBEdgecheckTo (const NBEdgeCont &ec)
 Checks whether the to-edge is still valid. More...
 

Private Attributes

NBEdgemyFrom
 The from- and the to-edges. More...
 
std::string myFromID
 The names of both edges, needed for verification of validity. More...
 
int myFromLane
 The lanes; may be -1 if no certain lane was specified. More...
 
int myTlIndex
 
NBEdgemyTo
 
std::string myToID
 
int myToLane
 

Friends

bool operator< (const NBConnection &c1, const NBConnection &c2)
 Compares both connections in order to allow sorting. More...
 
std::ostream & operator<< (std::ostream &os, const NBConnection &c)
 Output operator. More...
 

Detailed Description

Definition at line 51 of file NBConnection.h.

Constructor & Destructor Documentation

§ NBConnection() [1/4]

NBConnection::NBConnection ( NBEdge from,
NBEdge to 
)

Constructor.

Definition at line 54 of file NBConnection.cpp.

§ NBConnection() [2/4]

NBConnection::NBConnection ( NBEdge from,
int  fromLane,
NBEdge to,
int  toLane,
int  tlIndex = InvalidTlIndex 
)

Constructor.

Definition at line 71 of file NBConnection.cpp.

References Named::getID(), myFromID, and myToID.

§ NBConnection() [3/4]

NBConnection::NBConnection ( const std::string &  fromID,
NBEdge from,
const std::string &  toID,
NBEdge to 
)

Constructor.

Definition at line 62 of file NBConnection.cpp.

§ NBConnection() [4/4]

NBConnection::NBConnection ( const NBConnection c)

Constructor.

Definition at line 88 of file NBConnection.cpp.

§ ~NBConnection()

NBConnection::~NBConnection ( )
virtual

Destructor.

Definition at line 85 of file NBConnection.cpp.

Member Function Documentation

§ check()

bool NBConnection::check ( const NBEdgeCont ec)

checks whether the edges are still valid

Definition at line 197 of file NBConnection.cpp.

References checkFrom(), checkTo(), myFrom, and myTo.

Referenced by NIVissimDisturbance::addToNode(), NBLoadedTLDef::buildPhaseState(), NBLoadedTLDef::mustBrake(), and NBRequest::NBRequest().

§ checkFrom()

NBEdge * NBConnection::checkFrom ( const NBEdgeCont ec)
private

Checks whether the from-edge is still valid.

Definition at line 205 of file NBConnection.cpp.

References myFrom, myFromID, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().

Referenced by check().

§ checkTo()

NBEdge * NBConnection::checkTo ( const NBEdgeCont ec)
private

Checks whether the to-edge is still valid.

Definition at line 217 of file NBConnection.cpp.

References myFromID, myTo, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().

Referenced by check().

§ getFrom()

§ getFromLane()

§ getID()

std::string NBConnection::getID ( ) const

returns the id of the connection (!!! not really pretty)

Definition at line 229 of file NBConnection.cpp.

References myFromID, myFromLane, myToID, and myToLane.

Referenced by setTLIndex().

§ getTLIndex()

§ getTo()

§ getToLane()

int NBConnection::getToLane ( ) const

§ operator!=()

bool NBConnection::operator!= ( const NBConnection c) const
inline

Comparison operator.

Definition at line 119 of file NBConnection.h.

References operator<<.

§ operator==()

bool NBConnection::operator== ( const NBConnection c) const

Comparison operator.

Definition at line 188 of file NBConnection.cpp.

References myFrom, myFromID, myFromLane, myTlIndex, myTo, myToID, and myToLane.

Referenced by setTLIndex().

§ replaceFrom() [1/2]

bool NBConnection::replaceFrom ( NBEdge which,
NBEdge by 
)

replaces the from-edge by the one given

Definition at line 109 of file NBConnection.cpp.

References Named::getID(), myFrom, and myFromID.

Referenced by NBLoadedTLDef::SignalGroup::remapIncoming(), and NBNode::replaceInConnectionProhibitions().

§ replaceFrom() [2/2]

bool NBConnection::replaceFrom ( NBEdge which,
int  whichLane,
NBEdge by,
int  byLane 
)

replaces the from-edge by the one given

Definition at line 124 of file NBConnection.cpp.

References Named::getID(), myFrom, myFromID, and myFromLane.

§ replaceTo() [1/2]

bool NBConnection::replaceTo ( NBEdge which,
NBEdge by 
)

replaces the to-edge by the one given

Definition at line 141 of file NBConnection.cpp.

References Named::getID(), myTo, and myToID.

Referenced by NBLoadedTLDef::SignalGroup::remapOutgoing(), and NBNode::replaceInConnectionProhibitions().

§ replaceTo() [2/2]

bool NBConnection::replaceTo ( NBEdge which,
int  whichLane,
NBEdge by,
int  byLane 
)

replaces the to-edge by the one given

Definition at line 156 of file NBConnection.cpp.

References Named::getID(), myFromLane, myTo, myToID, and myToLane.

§ setTLIndex()

void NBConnection::setTLIndex ( int  tlIndex)
inline

§ shiftLaneIndex()

void NBConnection::shiftLaneIndex ( NBEdge edge,
int  offset 
)

patches lane indices refering to the given edge

Definition at line 249 of file NBConnection.cpp.

References myFrom, myFromLane, myTo, and myToLane.

Friends And Related Function Documentation

§ operator<

bool operator< ( const NBConnection c1,
const NBConnection c2 
)
friend

Compares both connections in order to allow sorting.

Definition at line 173 of file NBConnection.cpp.

Referenced by setTLIndex().

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const NBConnection c 
)
friend

Output operator.

Definition at line 259 of file NBConnection.cpp.

Referenced by operator!=().

Field Documentation

§ InvalidConnection

§ InvalidTlIndex

§ myFrom

NBEdge* NBConnection::myFrom
private

The from- and the to-edges.

Definition at line 138 of file NBConnection.h.

Referenced by check(), checkFrom(), getFrom(), operator==(), replaceFrom(), and shiftLaneIndex().

§ myFromID

std::string NBConnection::myFromID
private

The names of both edges, needed for verification of validity.

Definition at line 141 of file NBConnection.h.

Referenced by checkFrom(), checkTo(), getID(), NBConnection(), operator<(), operator==(), and replaceFrom().

§ myFromLane

int NBConnection::myFromLane
private

The lanes; may be -1 if no certain lane was specified.

Definition at line 144 of file NBConnection.h.

Referenced by getFromLane(), getID(), operator<(), operator==(), replaceFrom(), replaceTo(), and shiftLaneIndex().

§ myTlIndex

int NBConnection::myTlIndex
private

Definition at line 147 of file NBConnection.h.

Referenced by getTLIndex(), operator==(), and setTLIndex().

§ myTo

NBEdge * NBConnection::myTo
private

Definition at line 138 of file NBConnection.h.

Referenced by check(), checkTo(), getTo(), operator==(), replaceTo(), and shiftLaneIndex().

§ myToID

std::string NBConnection::myToID
private

Definition at line 141 of file NBConnection.h.

Referenced by checkFrom(), checkTo(), getID(), NBConnection(), operator<(), operator==(), and replaceTo().

§ myToLane

int NBConnection::myToLane
private

Definition at line 144 of file NBConnection.h.

Referenced by getID(), getToLane(), operator<(), operator==(), replaceTo(), and shiftLaneIndex().


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