42std::vector<std::string>
43MeanData::getIDList() {
44 std::vector<std::string> ids;
46 ids.push_back(item.first);
48 std::sort(ids.begin(), ids.end());
53MeanData::getIDCount() {
54 return (
int)getIDList().size();
59MeanData::getParameter(
const std::string& ,
const std::string& ) {
66MeanData::setParameter(
const std::string& ,
const std::string& ,
const std::string& ) {
78 auto it = mdMap.find(
id);
79 if (it == mdMap.end() || it->second.size() == 0) {
80 throw TraCIException(
"MeanData '" +
id +
"' is not known");
82 if (it->second.size() > 1) {
85 return it->second.front();
89std::shared_ptr<VariableWrapper>
99 return wrapper->wrapStringList(objID, variable, getIDList());
101 return wrapper->wrapInt(objID, variable, getIDCount());
104 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
107 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
#define WRITE_WARNINGF(...)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
static SubscriptionResults mySubscriptionResults
static MSMeanData * getMeanData(const std::string &id)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
static ContextSubscriptionResults myContextSubscriptionResults
const std::map< std::string, std::vector< MSMeanData * > > & getMeanData() const
MSDetectorControl & getDetectorControl()
Returns the detector control.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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