}
xbt_graph_t graph = xbt_graph_new_graph (0, nullptr);
- xbt_dict_t nodes = xbt_dict_new_homogeneous(nullptr);
- xbt_dict_t edges = xbt_dict_new_homogeneous(nullptr);
- xbt_edge_t edge = nullptr;
-
- xbt_dict_cursor_t cursor = nullptr;
- char *edge_name;
+ std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
+ std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
- xbt_dict_foreach(edges,cursor,edge_name,edge) {
+ for (auto elm : *edges) {
+ xbt_edge_t edge = elm.second;
linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
simgrid::instr::Container::byName(static_cast<const char*>(edge->dst->data)), filter);
}
- xbt_dict_free (&nodes);
- xbt_dict_free (&edges);
+ delete nodes;
+ delete edges;
xbt_graph_free_graph(graph, xbt_free_f, xbt_free_f, nullptr);
}
double bandwidth_value = link.bandwidth();
double latency_value = link.latency();
- container_t container = new simgrid::instr::Container(link.name(), simgrid::instr::INSTR_LINK, father);
+ container_t container = new simgrid::instr::Container(link.getCname(), simgrid::instr::INSTR_LINK, father);
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
simgrid::instr::Type* bandwidth = container->type_->getOrCreateVariableType("bandwidth", "");
return;
if (TRACE_is_enabled() && TRACE_needs_platform()) {
container_t father = currentContainer.back();
- new simgrid::instr::Container(netpoint->cname(), simgrid::instr::INSTR_ROUTER, father);
+ new simgrid::instr::Container(netpoint->getCname(), simgrid::instr::INSTR_ROUTER, father);
}
}
/*
* user categories support
*/
-static void recursiveNewVariableType(const char* new_typename, const char* color, simgrid::instr::Type* root)
+static void recursiveNewVariableType(std::string new_typename, const char* color, simgrid::instr::Type* root)
{
if (root->getName() == "HOST" || root->getName() == "MSG_VM")
root->getOrCreateVariableType(std::string("p") + new_typename, color == nullptr ? "" : color);
}
}
-void instr_new_variable_type (const char *new_typename, const char *color)
+void instr_new_variable_type(std::string new_typename, const char* color)
{
recursiveNewVariableType(new_typename, color, simgrid::instr::Type::getRootType());
}
-static void recursiveNewUserVariableType(const char* father_type, const char* new_typename, const char* color,
+static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, const char* color,
simgrid::instr::Type* root)
{
if (root->getName() == father_type) {
recursiveNewUserVariableType(father_type, new_typename, color, elm.second);
}
-void instr_new_user_variable_type (const char *father_type, const char *new_typename, const char *color)
+void instr_new_user_variable_type(std::string father_type, std::string new_typename, const char* color)
{
recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Type::getRootType());
}
-static void recursiveNewUserStateType(const char* father_type, const char* new_typename, simgrid::instr::Type* root)
+static void recursiveNewUserStateType(std::string father_type, std::string new_typename, simgrid::instr::Type* root)
{
if (root->getName() == father_type) {
root->getOrCreateStateType(new_typename);
recursiveNewUserStateType(father_type, new_typename, elm.second);
}
-void instr_new_user_state_type (const char *father_type, const char *new_typename)
+void instr_new_user_state_type(std::string father_type, std::string new_typename)
{
recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Type::getRootType());
}
-static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color,
+static void recursiveNewValueForUserStateType(std::string type_name, const char* val, const char* color,
simgrid::instr::Type* root)
{
if (root->getName() == type_name)
recursiveNewValueForUserStateType(type_name, val, color, elm.second);
}
-void instr_new_value_for_user_state_type (const char *type_name, const char *value, const char *color)
+void instr_new_value_for_user_state_type(std::string type_name, const char* value, const char* color)
{
recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Type::getRootType());
}
#define GRAPHICATOR_SUPPORT_FUNCTIONS
-static void recursiveXBTGraphExtraction(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, sg_netzone_t netzone,
+static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges, sg_netzone_t netzone,
container_t container)
{
if (not netzone->getChildren()->empty()) {
xbt_graph_t instr_routing_platform_graph ()
{
xbt_graph_t ret = xbt_graph_new_graph (0, nullptr);
- xbt_dict_t nodes = xbt_dict_new_homogeneous(nullptr);
- xbt_dict_t edges = xbt_dict_new_homogeneous(nullptr);
+ std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
+ std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
recursiveXBTGraphExtraction(ret, nodes, edges, simgrid::s4u::Engine::getInstance()->getNetRoot(),
PJ_container_get_root());
- xbt_dict_free (&nodes);
- xbt_dict_free (&edges);
+ delete nodes;
+ delete edges;
return ret;
}