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-2018 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 /****************************************************************************/
16 // Base class for nodes used by the router
17 /****************************************************************************/
18 #ifndef RONode_h
19 #define RONode_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <vector>
29 #include <utils/common/Named.h>
30 #include <utils/geom/Position.h>
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class ROEdge;
36 
37 typedef std::vector<const ROEdge*> ConstROEdgeVector;
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 class RONode : public Named {
47 public:
51  RONode(const std::string& id);
52 
53 
55  ~RONode();
56 
57 
61  void setPosition(const Position& p);
62 
63 
67  const Position& getPosition() const {
68  return myPosition;
69  }
70 
71 
72  inline const ConstROEdgeVector& getIncoming() const {
73  return myIncoming;
74  }
75 
76  inline const ConstROEdgeVector& getOutgoing() const {
77  return myOutgoing;
78  }
79 
80  void addIncoming(ROEdge* edge) {
81  myIncoming.push_back(edge);
82  }
83 
84  void addOutgoing(ROEdge* edge) {
85  myOutgoing.push_back(edge);
86  }
87 
88 private:
91 
96 
97 
98 private:
100  RONode(const RONode& src);
101 
103  RONode& operator=(const RONode& src);
104 
105 };
106 
107 
108 #endif
109 
110 /****************************************************************************/
111 
void addOutgoing(ROEdge *edge)
Definition: RONode.h:84
const Position & getPosition() const
Returns the position of the node.
Definition: RONode.h:67
RONode(const std::string &id)
Constructor.
Definition: RONode.cpp:32
RONode & operator=(const RONode &src)
Invalidated assignment operator.
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
ConstROEdgeVector myIncoming
incoming edges
Definition: RONode.h:93
void setPosition(const Position &p)
Sets the position of the node.
Definition: RONode.cpp:40
const ConstROEdgeVector & getIncoming() const
Definition: RONode.h:72
void addIncoming(ROEdge *edge)
Definition: RONode.h:80
A basic edge for routing applications.
Definition: ROEdge.h:72
Base class for objects which have an id.
Definition: Named.h:58
const ConstROEdgeVector & getOutgoing() const
Definition: RONode.h:76
~RONode()
Destructor.
Definition: RONode.cpp:36
ConstROEdgeVector myOutgoing
outgoing edges
Definition: RONode.h:95
Base class for nodes used by the router.
Definition: RONode.h:46
Position myPosition
This node&#39;s position.
Definition: RONode.h:90
std::vector< const ROEdge * > ConstROEdgeVector
Definition: RONode.h:35