Eclipse SUMO - Simulation of Urban MObility
RONode.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Base class for nodes used by the router
16 /****************************************************************************/
17 #ifndef RONode_h
18 #define RONode_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <vector>
28 #include <utils/common/Named.h>
29 #include <utils/geom/Position.h>
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class ROEdge;
35 
36 typedef std::vector<const ROEdge*> ConstROEdgeVector;
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
45 class RONode : public Named {
46 public:
50  RONode(const std::string& id);
51 
52 
54  ~RONode();
55 
56 
60  void setPosition(const Position& p);
61 
62 
66  const Position& getPosition() const {
67  return myPosition;
68  }
69 
70 
71  inline const ConstROEdgeVector& getIncoming() const {
72  return myIncoming;
73  }
74 
75  inline const ConstROEdgeVector& getOutgoing() const {
76  return myOutgoing;
77  }
78 
79  void addIncoming(ROEdge* edge) {
80  myIncoming.push_back(edge);
81  }
82 
83  void addOutgoing(ROEdge* edge) {
84  myOutgoing.push_back(edge);
85  }
86 
87 private:
90 
95 
96 
97 private:
99  RONode(const RONode& src);
100 
102  RONode& operator=(const RONode& src);
103 
104 };
105 
106 
107 #endif
108 
109 /****************************************************************************/
110 
RONode::myIncoming
ConstROEdgeVector myIncoming
incoming edges
Definition: RONode.h:92
RONode::getOutgoing
const ConstROEdgeVector & getOutgoing() const
Definition: RONode.h:75
Named
Base class for objects which have an id.
Definition: Named.h:56
RONode::~RONode
~RONode()
Destructor.
Definition: RONode.cpp:35
Named.h
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
RONode::operator=
RONode & operator=(const RONode &src)
Invalidated assignment operator.
RONode::addOutgoing
void addOutgoing(ROEdge *edge)
Definition: RONode.h:83
Position.h
RONode::myPosition
Position myPosition
This node's position.
Definition: RONode.h:89
RONode::setPosition
void setPosition(const Position &p)
Sets the position of the node.
Definition: RONode.cpp:39
RONode::addIncoming
void addIncoming(ROEdge *edge)
Definition: RONode.h:79
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
config.h
RONode::RONode
RONode(const std::string &id)
Constructor.
Definition: RONode.cpp:31
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: RONode.h:34
RONode::getIncoming
const ConstROEdgeVector & getIncoming() const
Definition: RONode.h:71
RONode
Base class for nodes used by the router.
Definition: RONode.h:45
RONode::getPosition
const Position & getPosition() const
Returns the position of the node.
Definition: RONode.h:66
ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
RONode::myOutgoing
ConstROEdgeVector myOutgoing
outgoing edges
Definition: RONode.h:94