NGEdge Class Reference

#include <NGEdge.h>


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 58 of file NGEdge.h.


Public Member Functions

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

Private Attributes

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

Constructor & Destructor Documentation

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

Constructor.

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

Parameters:
[in] id The id of the link
[in] StarNGNode The begin node
[in] EndNode The end node

Definition at line 57 of file NGEdge.cpp.

00058         : myID(id), myStartNode(startNode), myEndNode(endNode) {
00059     myStartNode->addLink(this);
00060     myEndNode->addLink(this);
00061 }

NGEdge::~NGEdge (  )  throw ()

Destructor.

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

Definition at line 64 of file NGEdge.cpp.

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

00064                         {
00065     myStartNode->removeLink(this);
00066     myEndNode->removeLink(this);
00067 }


Member Function Documentation

NBEdge * NGEdge::buildNBEdge ( NBNetBuilder nb  )  const throw (ProcessError)

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] nb The netbuilder to retrieve the referenced nodes from
Returns:
The built edge

Definition at line 71 of file NGEdge.cpp.

References NGNode::getID(), myEndNode, myID, and myStartNode.

00071                                                               {
00072     return new NBEdge(
00073                myID, // id
00074                nb.getNodeCont().retrieve(myStartNode->getID()), // from
00075                nb.getNodeCont().retrieve(myEndNode->getID()), // to
00076                "netgen-default", // type
00077                nb.getTypeCont().getDefaultSpeed(),
00078                nb.getTypeCont().getDefaultNoLanes(),
00079                nb.getTypeCont().getDefaultPriority()
00080            );
00081 }

NGNode* NGEdge::getEndNode (  )  throw () [inline]

Returns this link's end node.

Returns:
The end node of the link

Definition at line 100 of file NGEdge.h.

References myEndNode.

00100                                  {
00101         return myEndNode;
00102     };

const std::string& NGEdge::getID (  )  const throw () [inline]

Returns this link's id.

Returns:
The id of the link

Definition at line 82 of file NGEdge.h.

References myID.

00082                                            {
00083         return myID;
00084     }

NGNode* NGEdge::getStartNode (  )  throw () [inline]

Returns this link's start node.

Returns:
The start node of the link

Definition at line 91 of file NGEdge.h.

References myStartNode.

00091                                    {
00092         return myStartNode;
00093     };


Field Documentation

The node the edge ends at.

Definition at line 125 of file NGEdge.h.

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

std::string NGEdge::myID [private]

The id of the edge.

Definition at line 119 of file NGEdge.h.

Referenced by buildNBEdge(), and getID().

The node the edge starts at.

Definition at line 122 of file NGEdge.h.

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


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

Generated on Wed May 5 00:06:52 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6