/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2012-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 Junction.h14/// @author Daniel Krajzewicz15/// @author Mario Krumnow16/// @author Michael Behrisch17/// @date 30.05.201218///19// C++ TraCI client API implementation20/****************************************************************************/21#pragma once22#include <vector>23#include <libsumo/TraCIDefs.h>24#include <libsumo/TraCIConstants.h>252627// ===========================================================================28// class declarations29// ===========================================================================30#ifndef LIBTRACI31class NamedRTree;32class MSJunction;33class PositionVector;34#endif3536// ===========================================================================37// class definitions38// ===========================================================================39/**40* @class Junction41* @brief C++ TraCI client API implementation42*/43namespace LIBSUMO_NAMESPACE {44class Junction {45public:46static libsumo::TraCIPosition getPosition(const std::string& junctionID, bool includeZ = false);47static libsumo::TraCIPositionVector getShape(const std::string& junctionID);48static const std::vector<std::string> getIncomingEdges(const std::string& junctionID);49static const std::vector<std::string> getOutgoingEdges(const std::string& junctionID);5051LIBSUMO_ID_PARAMETER_API52LIBSUMO_SUBSCRIPTION_API5354#ifndef LIBTRACI55#ifndef SWIG56/** @brief Saves the shape of the requested object in the given container57* @param id The id of the poi to retrieve58* @param shape The container to fill59*/60static void storeShape(const std::string& id, PositionVector& shape);6162/** @brief Returns a tree filled with junction instances63* @return The rtree of junctions64*/65static NamedRTree* getTree();66static void cleanup();6768static std::shared_ptr<VariableWrapper> makeWrapper();6970static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);7172private:73static MSJunction* getJunction(const std::string& id);7475private:76static SubscriptionResults mySubscriptionResults;77static ContextSubscriptionResults myContextSubscriptionResults;78static NamedRTree* myTree;79#endif80#endif81private:82/// @brief invalidated standard constructor83Junction() = delete;84};85}868788