- if (not strcmp(root->name, "HOST")) {
- char tnstr[INSTR_DEFAULT_STR_SIZE];
- snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
- Type::variableNew (tnstr, color, root);
- }
- if (not strcmp(root->name, "MSG_VM")) {
- char tnstr[INSTR_DEFAULT_STR_SIZE];
- snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
- Type::variableNew (tnstr, color, root);
- }
- if (not strcmp(root->name, "LINK")) {
- char tnstr[INSTR_DEFAULT_STR_SIZE];
- snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
- Type::variableNew (tnstr, color, root);
- }
- xbt_dict_cursor_t cursor = nullptr;
- type_t child_type;
- char *name;
- xbt_dict_foreach(root->children, cursor, name, child_type) {
- recursiveNewVariableType (new_typename, color, child_type);
+ if (root->getName() == "HOST" || root->getName() == "MSG_VM")
+ root->getOrCreateVariableType(std::string("p") + new_typename, color);
+
+ if (root->getName() == "LINK")
+ root->getOrCreateVariableType(std::string("b") + new_typename, color);
+
+ for (auto elm : root->children_) {
+ recursiveNewVariableType(new_typename, color, elm.second);