/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file RONode.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @author Ruediger Ebendt17/// @date Sept 200218///19// Base class for nodes used by the router20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <vector>26#include <utils/common/Named.h>27#include <utils/geom/Position.h>28#include <utils/router/FlippedNode.h>29#include <router/ROVehicle.h>3031// ===========================================================================32// class declarations33// ===========================================================================34class ROEdge;3536typedef std::vector<const ROEdge*> ConstROEdgeVector;3738// ===========================================================================39// class definitions40// ===========================================================================41/**42* @class RONode43* @brief Base class for nodes used by the router44*/45class RONode : public Named {46public:47/** @brief Constructor48* @param[in] id The id of the node49*/50RONode(const std::string& id);515253/// @brief Destructor54~RONode();555657/** @brief Sets the position of the node58* @param[in] p The node's position59*/60void setPosition(const Position& p);616263/** @brief Returns the position of the node64* @return This node's position65*/66const Position& getPosition() const {67return myPosition;68}697071inline const ConstROEdgeVector& getIncoming() const {72return myIncoming;73}7475inline const ConstROEdgeVector& getOutgoing() const {76return myOutgoing;77}7879void addIncoming(ROEdge* edge) {80myIncoming.push_back(edge);81}8283void addOutgoing(ROEdge* edge) {84myOutgoing.push_back(edge);85}8687/// @brief Returns the flipped routing node88// @note If not called before, the flipped routing node is created89FlippedNode<ROEdge, RONode, ROVehicle>* getFlippedRoutingNode() const {90if (myFlippedRoutingNode == nullptr) {91myFlippedRoutingNode = new FlippedNode<ROEdge, RONode, ROVehicle>(this);92}93return myFlippedRoutingNode;94}9596private:97/// @brief This node's position98Position myPosition;99100/// @brief Incoming edges101ConstROEdgeVector myIncoming;102/// @brief Outgoing edges103ConstROEdgeVector myOutgoing;104/// @brief Flipped routing node105mutable FlippedNode<ROEdge, RONode, ROVehicle>* myFlippedRoutingNode = nullptr;106107108private:109/// @brief Invalidated copy constructor110RONode(const RONode& src);111112/// @brief Invalidated assignment operator113RONode& operator=(const RONode& src);114115};116117118