SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RONode.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Base class for nodes used by the router
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef RONode_h
22 #define RONode_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
36 #include <utils/common/Named.h>
37 #include <utils/geom/Position.h>
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class ROEdge;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 class RONode : public Named {
52 public:
56  RONode(const std::string& id);
57 
58 
60  ~RONode();
61 
62 
66  void setPosition(const Position& p);
67 
68 
72  const Position& getPosition() {
73  return myPosition;
74  }
75 
76 
77  inline const std::vector<const ROEdge*>& getIncoming() const {
78  return myIncoming;
79  }
80 
81  inline const std::vector<const ROEdge*>& getOutgoing() const {
82  return myOutgoing;
83  }
84 
85  void addIncoming(ROEdge* edge) {
86  myIncoming.push_back(edge);
87  }
88 
89  void addOutgoing(ROEdge* edge) {
90  myOutgoing.push_back(edge);
91  }
92 
93 private:
96 
98  std::vector<const ROEdge*> myIncoming;
100  std::vector<const ROEdge*> myOutgoing;
101 
102 
103 private:
105  RONode(const RONode& src);
106 
108  RONode& operator=(const RONode& src);
109 
110 };
111 
112 
113 #endif
114 
115 /****************************************************************************/
116 
void addOutgoing(ROEdge *edge)
Definition: RONode.h:89
RONode(const std::string &id)
Constructor.
Definition: RONode.cpp:43
RONode & operator=(const RONode &src)
Invalidated assignment operator.
std::vector< const ROEdge * > myOutgoing
outgoing edges
Definition: RONode.h:100
const Position & getPosition()
Returns the position of the node.
Definition: RONode.h:72
const std::vector< const ROEdge * > & getOutgoing() const
Definition: RONode.h:81
std::vector< const ROEdge * > myIncoming
incoming edges
Definition: RONode.h:98
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
const std::vector< const ROEdge * > & getIncoming() const
Definition: RONode.h:77
void setPosition(const Position &p)
Sets the position of the node.
Definition: RONode.cpp:51
void addIncoming(ROEdge *edge)
Definition: RONode.h:85
A basic edge for routing applications.
Definition: ROEdge.h:69
Base class for objects which have an id.
Definition: Named.h:45
~RONode()
Destructor.
Definition: RONode.cpp:47
Base class for nodes used by the router.
Definition: RONode.h:51
Position myPosition
This node's position.
Definition: RONode.h:95