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

A netgen-representation of an edge. More...

#include <NGEdge.h>

Public Member Functions

NBEdgebuildNBEdge (NBNetBuilder &nb) const
 Builds and returns this link's netbuild-representation. More...
 
NGNodegetEndNode ()
 Returns this link's end node. More...
 
const std::string & getID () const
 Returns this link's id. More...
 
NGNodegetStartNode ()
 Returns this link's start node. More...
 
 NGEdge (const std::string &id, NGNode *startNode, NGNode *endNode)
 Constructor. More...
 
 ~NGEdge ()
 Destructor. More...
 

Private Attributes

NGNodemyEndNode
 The node the edge ends at. More...
 
std::string myID
 The id of the edge. More...
 
NGNodemyStartNode
 The node the edge starts at. More...
 

Detailed Description

A netgen-representation of an edge.

Please note that the edge makes itself known to the from- and the to-nodes on initialisation and removes this information from the nodes when being deleted. This implicates that nodes have to be deleted after the edges.

Definition at line 61 of file NGEdge.h.

Constructor & Destructor Documentation

NGEdge::NGEdge ( const std::string &  id,
NGNode startNode,
NGNode endNode 
)

Constructor.

Adds itself to the start and the end node's lists of connections.

Parameters
[in]idThe id of the link
[in]StarNGNodeThe begin node
[in]EndNodeThe end node

Definition at line 60 of file NGEdge.cpp.

References NGNode::addLink(), myEndNode, and myStartNode.

NGEdge::~NGEdge ( )

Destructor.

Removes itself from the start and the end node's lists of connections.

Definition at line 67 of file NGEdge.cpp.

References myEndNode, myStartNode, and NGNode::removeLink().

Member Function Documentation

NBEdge * NGEdge::buildNBEdge ( NBNetBuilder nb) const

Builds and returns this link's netbuild-representation.

Returns an edge built using the known values. Other values, such as the number of lanes, are gathered from defaults. The starting and the ending node must have been built in prior.

Parameters
[in]nbThe netbuilder to retrieve the referenced nodes from
Returns
The built edge

Definition at line 74 of file NGEdge.cpp.

References NGNode::getID(), NBNetBuilder::getNodeCont(), NBTypeCont::getNumLanes(), NBTypeCont::getPriority(), NBTypeCont::getSpeed(), NBNetBuilder::getTypeCont(), NBTypeCont::getWidth(), myEndNode, myID, myStartNode, NBNodeCont::retrieve(), and NBEdge::UNSPECIFIED_OFFSET.

NGNode* NGEdge::getEndNode ( )
inline

Returns this link's end node.

Returns
The end node of the link

Definition at line 103 of file NGEdge.h.

References myEndNode.

const std::string& NGEdge::getID ( ) const
inline

Returns this link's id.

Returns
The id of the link

Definition at line 85 of file NGEdge.h.

References myID.

NGNode* NGEdge::getStartNode ( )
inline

Returns this link's start node.

Returns
The start node of the link

Definition at line 94 of file NGEdge.h.

References myStartNode.

Field Documentation

NGNode* NGEdge::myEndNode
private

The node the edge ends at.

Definition at line 128 of file NGEdge.h.

Referenced by buildNBEdge(), getEndNode(), NGEdge(), and ~NGEdge().

std::string NGEdge::myID
private

The id of the edge.

Definition at line 122 of file NGEdge.h.

Referenced by buildNBEdge(), and getID().

NGNode* NGEdge::myStartNode
private

The node the edge starts at.

Definition at line 125 of file NGEdge.h.

Referenced by buildNBEdge(), getStartNode(), NGEdge(), and ~NGEdge().


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