Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
RONode.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
20// Base class for nodes used by the router
21/****************************************************************************/
22#pragma once
23#include <config.h>
24
25#include <string>
26#include <vector>
27#include <utils/common/Named.h>
28#include <utils/geom/Position.h>
30#include <router/ROVehicle.h>
31
32// ===========================================================================
33// class declarations
34// ===========================================================================
35class ROEdge;
36
37typedef std::vector<const ROEdge*> ConstROEdgeVector;
38
39// ===========================================================================
40// class definitions
41// ===========================================================================
46class RONode : public Named {
47public:
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
89 // @note If not called before, the flipped routing node is created
96
97private:
100
107
108
109private:
111 RONode(const RONode& src);
112
114 RONode& operator=(const RONode& src);
115
116};
std::vector< const ROEdge * > ConstROEdgeVector
Definition RONode.h:37
the node type representing nodes used for backward search
Definition FlippedNode.h:32
Base class for objects which have an id.
Definition Named.h:54
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A basic edge for routing applications.
Definition ROEdge.h:72
Base class for nodes used by the router.
Definition RONode.h:46
const ConstROEdgeVector & getOutgoing() const
Definition RONode.h:76
void addOutgoing(ROEdge *edge)
Definition RONode.h:84
RONode & operator=(const RONode &src)
Invalidated assignment operator.
FlippedNode< ROEdge, RONode, ROVehicle > * getFlippedRoutingNode() const
Returns the flipped routing node.
Definition RONode.h:90
void addIncoming(ROEdge *edge)
Definition RONode.h:80
ConstROEdgeVector myIncoming
Incoming edges.
Definition RONode.h:102
void setPosition(const Position &p)
Sets the position of the node.
Definition RONode.cpp:41
~RONode()
Destructor.
Definition RONode.cpp:35
RONode(const RONode &src)
Invalidated copy constructor.
ConstROEdgeVector myOutgoing
Outgoing edges.
Definition RONode.h:104
FlippedNode< ROEdge, RONode, ROVehicle > * myFlippedRoutingNode
Flipped routing node.
Definition RONode.h:106
Position myPosition
This node's position.
Definition RONode.h:99
const ConstROEdgeVector & getIncoming() const
Definition RONode.h:72
const Position & getPosition() const
Returns the position of the node.
Definition RONode.h:67