SUMO - Simulation of Urban MObility
NBConnection Class Reference

#include <NBConnection.h>

Public Member Functions

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

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.
NBEdgecheckTo (const NBEdgeCont &ec)
 Checks whether the to-edge is still valid.

Private Attributes

NBEdgemyFrom
 The from- and the to-edges.
std::string myFromID
 The names of both edges, needed for verification of validity.
int myFromLane
 The lanes; may be -1 if no certain lane was specified.
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.

Detailed Description

Definition at line 51 of file NBConnection.h.


Constructor & Destructor Documentation

NBConnection::NBConnection ( NBEdge from,
NBEdge to 
)

Constructor.

Definition at line 54 of file NBConnection.cpp.

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::NBConnection ( const std::string &  fromID,
NBEdge from,
const std::string &  toID,
NBEdge to 
)

Constructor.

Definition at line 62 of file NBConnection.cpp.

Constructor.

Definition at line 88 of file NBConnection.cpp.

Destructor.

Definition at line 85 of file NBConnection.cpp.


Member Function Documentation

checks whether the edges are still valid

Definition at line 181 of file NBConnection.cpp.

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

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

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

Checks whether the from-edge is still valid.

Definition at line 189 of file NBConnection.cpp.

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

Referenced by check().

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

Checks whether the to-edge is still valid.

Definition at line 201 of file NBConnection.cpp.

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

Referenced by check().

std::string NBConnection::getID ( ) const

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

Definition at line 213 of file NBConnection.cpp.

References myFromID, myFromLane, myToID, and myToLane.

returns the to-lane

Definition at line 227 of file NBConnection.cpp.

References myToLane.

Referenced by NBLoadedSUMOTLDef::connection_equal::operator()(), and NBEdge::setControllingTLInformation().

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

Comparison operator.

Definition at line 117 of file NBConnection.h.

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

Comparison operator.

Definition at line 172 of file NBConnection.cpp.

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

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().

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

replaces the from-edge by the one given

Definition at line 120 of file NBConnection.cpp.

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

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

replaces the to-edge by the one given

Definition at line 133 of file NBConnection.cpp.

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

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

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

replaces the to-edge by the one given

Definition at line 144 of file NBConnection.cpp.

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

void NBConnection::setTLIndex ( int  tlIndex) [inline]

Definition at line 103 of file NBConnection.h.

References myTlIndex.

Referenced by NBLoadedSUMOTLDef::removeConnection().


Friends And Related Function Documentation

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

Compares both connections in order to allow sorting.

Definition at line 157 of file NBConnection.cpp.


Field Documentation

Definition at line 122 of file NBConnection.h.

const int NBConnection::InvalidTlIndex = -1 [static]

Definition at line 121 of file NBConnection.h.

The from- and the to-edges.

Definition at line 133 of file NBConnection.h.

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

std::string NBConnection::myFromID [private]

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

Definition at line 136 of file NBConnection.h.

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

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

Definition at line 139 of file NBConnection.h.

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

Definition at line 142 of file NBConnection.h.

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

Definition at line 133 of file NBConnection.h.

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

std::string NBConnection::myToID [private]

Definition at line 136 of file NBConnection.h.

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

Definition at line 139 of file NBConnection.h.

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


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines