Path: blob/main/src/traci-server/TraCIServerAPI_TrafficLight.h
169665 views
/****************************************************************************/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 TraCIServerAPI_TrafficLight.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date 07.05.200917///18// APIs for getting/setting traffic light values via TraCI19/****************************************************************************/20#pragma once21#include <config.h>2223#include "TraCIServer.h"24#include <foreign/tcpip/storage.h>2526class TraCISignalConstraint;2728// ===========================================================================29// class definitions30// ===========================================================================31/**32* @class TraCIServerAPI_TrafficLight33* @brief APIs for getting/setting traffic light values via TraCI34*/35class TraCIServerAPI_TrafficLight {36public:37/** @brief Processes a get value command (Command 0xa2: Get Traffic Lights Variable)38*39* @param[in] server The TraCI-server-instance which schedules this request40* @param[in] inputStorage The storage to read the command from41* @param[out] outputStorage The storage to write the result to42*/43static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage,44tcpip::Storage& outputStorage);454647/** @brief Processes a set value command (Command 0xc2: Change Traffic Lights State)48*49* @param[in] server The TraCI-server-instance which schedules this request50* @param[in] inputStorage The storage to read the command from51* @param[out] outputStorage The storage to write the result to52*/53static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage,54tcpip::Storage& outputStorage);55private:56static void writeConstraint(TraCIServer& server, const libsumo::TraCISignalConstraint& c);5758private:59/// @brief invalidated copy constructor60TraCIServerAPI_TrafficLight(const TraCIServerAPI_TrafficLight& s);6162/// @brief invalidated assignment operator63TraCIServerAPI_TrafficLight& operator=(const TraCIServerAPI_TrafficLight& s);646566};676869