Eclipse SUMO - Simulation of Urban MObility
TraCIServerAPI_Simulation.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // APIs for getting/setting edge values via TraCI
17 /****************************************************************************/
18 #ifndef TraCIServerAPI_Simulation_h
19 #define TraCIServerAPI_Simulation_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
29 #include <vector>
30 #include "TraCIServer.h"
31 #include <foreign/tcpip/storage.h>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
42 public:
49  static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage,
50  tcpip::Storage& outputStorage);
51 
58  static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage,
59  tcpip::Storage& outputStorage);
60 
61  static void writeStage(tcpip::Storage& outputStorage, const libsumo::TraCIStage& stage);
62  static libsumo::TraCIStage* readStage(TraCIServer& server, tcpip::Storage& inputStorage);
63 
64 private:
72  static bool commandPositionConversion(TraCIServer& server, tcpip::Storage& inputStorage,
73  const int compoundSize, tcpip::Storage& outputStorage,
74  const int commandId);
75 
76  static bool commandDistanceRequest(TraCIServer& server, tcpip::Storage& inputStorage,
77  tcpip::Storage& outputStorage, int commandId);
78 
79  static void writeVehicleStateNumber(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
80  static void writeVehicleStateIDs(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
81 
82 
83 private:
86 
89 
90 
91 };
92 
93 
94 #endif
95 
96 /****************************************************************************/
97 
TraCIServerAPI_Simulation::commandPositionConversion
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId)
Definition: TraCIServerAPI_Simulation.cpp:399
TraCIServerAPI_Simulation::writeVehicleStateIDs
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
Definition: TraCIServerAPI_Simulation.cpp:340
TraCIServerAPI_Simulation::processGet
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
Definition: TraCIServerAPI_Simulation.cpp:48
TraCIServerAPI_Simulation::writeStage
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
Definition: TraCIServerAPI_Simulation.cpp:348
TraCIServerAPI_Simulation::readStage
static libsumo::TraCIStage * readStage(TraCIServer &server, tcpip::Storage &inputStorage)
Definition: TraCIServerAPI_Simulation.cpp:380
TraCIServerAPI_Simulation::processSet
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
Definition: TraCIServerAPI_Simulation.cpp:288
TraCIServerAPI_Simulation::TraCIServerAPI_Simulation
TraCIServerAPI_Simulation(const TraCIServerAPI_Simulation &s)
invalidated copy constructor
MSNet::VehicleState
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:536
libsumo::TraCIStage
Definition: TraCIDefs.h:345
storage.h
TraCIServerAPI_Simulation
APIs for getting/setting simulation values via TraCI.
Definition: TraCIServerAPI_Simulation.h:41
TraCIServer.h
config.h
TraCIServerAPI_Simulation::commandDistanceRequest
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
Definition: TraCIServerAPI_Simulation.cpp:506
TraCIServer
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:62
TraCIServerAPI_Simulation::operator=
TraCIServerAPI_Simulation & operator=(const TraCIServerAPI_Simulation &s)
invalidated assignment operator
tcpip::Storage
Definition: storage.h:36
TraCIServerAPI_Simulation::writeVehicleStateNumber
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
Definition: TraCIServerAPI_Simulation.cpp:332