41 std::vector<std::string>
42 Rerouter::getIDList() {
44 std::vector<std::string> ids;
46 ids.push_back(item.first);
52 Rerouter::getIDCount() {
58 Rerouter::getParameter(
const std::string& ,
const std::string& ) {
67 Rerouter::setParameter(
const std::string& ,
const std::string& ,
const std::string& ) {
77 Rerouter::getRerouter(
const std::string&
id) {
80 throw TraCIException(
"Rerouter '" +
id +
"' is not known");
86 std::shared_ptr<VariableWrapper>
87 Rerouter::makeWrapper() {
88 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
93 Rerouter::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData) {
96 return wrapper->wrapStringList(objID, variable, getIDList());
98 return wrapper->wrapInt(objID, variable, getIDCount());
101 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
104 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Reroutes traffic objects passing an edge.
static const std::map< std::string, MSTriggeredRerouter * > & getInstances()
return all rerouter instances
C++ TraCI client API implementation.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int TRACI_ID_LIST
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_PARAMETER_WITH_KEY