/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2017-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 Route.cpp14/// @author Daniel Krajzewicz15/// @author Mario Krumnow16/// @author Jakob Erdmann17/// @author Michael Behrisch18/// @author Robert Hilbrich19/// @date 30.05.201220///21// C++ TraCI client API implementation22/****************************************************************************/23#include <config.h>2425#define LIBTRACI 126#include <libsumo/Route.h>27#include "Connection.h"28#include "Domain.h"293031namespace libtraci {3233typedef Domain<libsumo::CMD_GET_ROUTE_VARIABLE, libsumo::CMD_SET_ROUTE_VARIABLE> Dom;343536// ===========================================================================37// static member definitions38// ===========================================================================39std::vector<std::string>40Route::getIDList() {41return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");42}434445std::vector<std::string>46Route::getEdges(const std::string& routeID) {47return Dom::getStringVector(libsumo::VAR_EDGES, routeID);48}495051int52Route::getIDCount() {53return Dom::getInt(libsumo::ID_COUNT, "");54}555657LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(Route, ROUTE)58LIBTRACI_PARAMETER_IMPLEMENTATION(Route, ROUTE)596061void62Route::add(const std::string& routeID, const std::vector<std::string>& edgeIDs) {63Dom::setStringVector(libsumo::ADD, routeID, edgeIDs);64}6566void67Route::remove(const std::string& routeID) {68tcpip::Storage content;69Dom::set(libsumo::REMOVE, routeID, &content);70}7172}73/****************************************************************************/747576