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 /****************************************************************************/
15 // APIs for getting/setting edge values via TraCI
16 /****************************************************************************/
17 #ifndef TraCIServerAPI_Simulation_h
18 #define TraCIServerAPI_Simulation_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
28 #include <vector>
29 #include "TraCIServer.h"
30 #include <foreign/tcpip/storage.h>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 public:
48  static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage,
49  tcpip::Storage& outputStorage);
50 
57  static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage,
58  tcpip::Storage& outputStorage);
59 
60  static void writeStage(tcpip::Storage& outputStorage, const libsumo::TraCIStage& stage);
61  static libsumo::TraCIStage* readStage(TraCIServer& server, tcpip::Storage& inputStorage);
62 
63 private:
71  static bool commandPositionConversion(TraCIServer& server, tcpip::Storage& inputStorage,
72  const int compoundSize, tcpip::Storage& outputStorage,
73  const int commandId);
74 
75  static bool commandDistanceRequest(TraCIServer& server, tcpip::Storage& inputStorage,
76  tcpip::Storage& outputStorage, int commandId);
77 
78  static void writeVehicleStateNumber(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
79  static void writeVehicleStateIDs(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
80 
81 
82 private:
85 
88 
89 
90 };
91 
92 
93 #endif
94 
95 /****************************************************************************/
96 
TraCIServerAPI_Simulation::commandPositionConversion
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, const int compoundSize, tcpip::Storage &outputStorage, const int commandId)
Definition: TraCIServerAPI_Simulation.cpp:414
TraCIServerAPI_Simulation::writeVehicleStateIDs
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
Definition: TraCIServerAPI_Simulation.cpp:355
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:47
TraCIServerAPI_Simulation::writeStage
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
Definition: TraCIServerAPI_Simulation.cpp:363
TraCIServerAPI_Simulation::readStage
static libsumo::TraCIStage * readStage(TraCIServer &server, tcpip::Storage &inputStorage)
Definition: TraCIServerAPI_Simulation.cpp:395
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:293
TraCIServerAPI_Simulation::TraCIServerAPI_Simulation
TraCIServerAPI_Simulation(const TraCIServerAPI_Simulation &s)
invalidated copy constructor
MSNet::VehicleState
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:535
libsumo::TraCIStage
Definition: TraCIDefs.h:344
storage.h
TraCIServerAPI_Simulation
APIs for getting/setting simulation values via TraCI.
Definition: TraCIServerAPI_Simulation.h:40
TraCIServer.h
config.h
TraCIServerAPI_Simulation::commandDistanceRequest
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
Definition: TraCIServerAPI_Simulation.cpp:521
TraCIServer
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:61
TraCIServerAPI_Simulation::operator=
TraCIServerAPI_Simulation & operator=(const TraCIServerAPI_Simulation &s)
invalidated assignment operator
tcpip::Storage
Definition: storage.h:37
TraCIServerAPI_Simulation::writeVehicleStateNumber
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
Definition: TraCIServerAPI_Simulation.cpp:347