/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2004-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 ROAbstractEdgeBuilder.h14/// @author Daniel Krajzewicz15/// @author Yun-Pang Floetteroed16/// @date Wed, 21 Jan 200417///18// Interface for building instances of router-edges19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>242526// ===========================================================================27// class declarations28// ===========================================================================29class ROEdge;30class RONode;313233// ===========================================================================34// class definitions35// ===========================================================================36/**37* @class ROAbstractEdgeBuilder38* @brief Interface for building instances of router-edges39*40* As the different routing algorithms may need certain types of edges,41* edges are build via a factory object derived from this class.42*43* The only method to be implemented is "buildEdge" which builds an edge44* of the needed ROEdge-subtype.45*46* The built edges are numbered in the order they are built, the current47* number (index) is stored in "myCurrentIndex" and the next to use may48* be obtained via "getNextIndex".49*/50class ROAbstractEdgeBuilder {51public:52/// @brief Constructor53ROAbstractEdgeBuilder() : myCurrentIndex(0) { }545556/// @brief Destructor57virtual ~ROAbstractEdgeBuilder() { }585960/// @name Methods to be implemented61/// @{6263/** @brief Builds an edge with the given name64*65* @param[in] name The name of the edge66* @param[in] from The node the edge begins at67* @param[in] to The node the edge ends at68* @param[in] priority The edge priority (road class)69* @return A proper instance of the named edge70*/71virtual ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority, const std::string& type) = 0;72/// @}737475protected:76/** @brief Returns the index of the edge to built77* @return Next valid edge index78*/79int getNextIndex() {80return myCurrentIndex++;81}828384private:85/// @brief The next edge's index86int myCurrentIndex;878889private:90/// @brief Invalidated copy constructor91ROAbstractEdgeBuilder(const ROAbstractEdgeBuilder& src);9293/// @brief Invalidated assignment operator94ROAbstractEdgeBuilder& operator=(const ROAbstractEdgeBuilder& src);9596};979899