X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d442cebf6863fc131f3fcf453039a70e6b014d11..bc0e9c9ecdf8b93f139978e522433f0a9fdcdedd:/src/msg/msg_environment.cpp diff --git a/src/msg/msg_environment.cpp b/src/msg/msg_environment.cpp index 122783e9e5..3c3bdf8693 100644 --- a/src/msg/msg_environment.cpp +++ b/src/msg/msg_environment.cpp @@ -65,7 +65,11 @@ msg_netzone_t MSG_environment_as_get_by_name(const char* name) xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t netzone) { - return netzone->children(); + xbt_dict_t res = xbt_dict_new_homogeneous(nullptr); + for (auto elem : *netzone->children()) { + xbt_dict_set(res, elem->name(), static_cast(elem), nullptr); + } + return res; } const char* MSG_environment_as_get_property_value(msg_netzone_t netzone, const char* name) @@ -80,7 +84,13 @@ void MSG_environment_as_set_property_value(msg_netzone_t netzone, const char* na xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t netzone) { - return netzone->hosts(); + xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr); + + for (auto host : *netzone->hosts()) { + xbt_dynar_push(res, &host); + } + + return res; } SG_END_DECL()