> 16 0 17 0 topology 21 44
> 15 0 17 0 topology 30 45
> 16 0 17 0 topology 28 45
-> 1 20 13 bmigration_order "0.800026 0.545312 0.857926"
-> 1 21 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 20 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 21 13 bmigration_order "0.800026 0.545312 0.857926"
> 6 0 32 4 3 "emigrant-1"
> 6 0 33 4 1 "policeman-2"
> 12 0 5 32 7
> 16 0 17 0 topology 21 44
> 15 0 17 0 topology 30 45
> 16 0 17 0 topology 28 45
-> 1 20 13 bmigration_order "0.800026 0.545312 0.857926"
-> 1 21 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 20 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 21 13 bmigration_order "0.800026 0.545312 0.857926"
> 6 0 32 4 3 "emigrant-1"
> 6 0 33 4 1 "policeman-2"
> 12 0 5 32 7
> 16 0 6 0 topology 21 44
> 15 0 6 0 topology 30 45
> 16 0 6 0 topology 28 45
-> 1 9 3 bmigration_order "0.800026 0.545312 0.857926"
-> 1 10 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 9 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 10 3 bmigration_order "0.800026 0.545312 0.857926"
> 7 18.155073 3 16
> 7 18.155073 3 14
> 7 18.155073 3 19
}
this->name_ = xbt_strdup(typeNameBuff);
- this->children_ = xbt_dict_new_homogeneous(nullptr);
-
this->id_ = bprintf("%lld", instr_new_paje_id());
if (father != nullptr){
- xbt_dict_set(father->children_, key, this, nullptr);
+ father->children_.insert({key, this});
XBT_DEBUG("new type %s, child of %s", typeNameBuff, father->name_);
}
}
simgrid::instr::Type::~Type()
{
- xbt_dict_cursor_t cursor = nullptr;
for (auto elm : values_) {
XBT_DEBUG("free value %s, child of %s", elm.second->getCname(), elm.second->father_->name_);
delete elm.second;
}
- simgrid::instr::Type* child;
- char *child_name;
- xbt_dict_foreach (children_, cursor, child_name, child) {
- delete child;
+ for (auto elm : children_) {
+ delete elm.second;
}
- xbt_dict_free(&children_);
xbt_free(name_);
xbt_free(id_);
}
xbt_assert(name != nullptr, "can't get type with a nullptr name");
simgrid::instr::Type* ret = nullptr;
- simgrid::instr::Type* child;
- char *child_name;
- xbt_dict_cursor_t cursor = nullptr;
- xbt_dict_foreach (children_, cursor, child_name, child) {
- if (strcmp(child->name_, name) == 0) {
+ for (auto elm : children_) {
+ if (strcmp(elm.second->name_, name) == 0) {
if (ret != nullptr) {
THROWF (tracing_error, 0, "there are two children types with the same name?");
} else {
- ret = child;
+ ret = elm.second;
}
}
}
snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
simgrid::instr::Type::variableNew(tnstr, color == nullptr ? "" : color, root);
}
- xbt_dict_cursor_t cursor = nullptr;
- simgrid::instr::Type* child_type;
- char *name;
- xbt_dict_foreach (root->children_, cursor, name, child_type) {
- recursiveNewVariableType(new_typename, color == nullptr ? "" : color, child_type);
+ for (auto elm : root->children_) {
+ recursiveNewVariableType(new_typename, color == nullptr ? "" : color, elm.second);
}
}
if (not strcmp(root->name_, father_type)) {
simgrid::instr::Type::variableNew(new_typename, color == nullptr ? "" : color, root);
}
- xbt_dict_cursor_t cursor = nullptr;
- simgrid::instr::Type* child_type;
- char *name;
- xbt_dict_foreach (root->children_, cursor, name, child_type) {
- recursiveNewUserVariableType (father_type, new_typename, color, child_type);
- }
+ for (auto elm : root->children_)
+ 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)
if (not strcmp(root->name_, father_type)) {
simgrid::instr::Type::stateNew(new_typename, root);
}
- xbt_dict_cursor_t cursor = nullptr;
- simgrid::instr::Type* child_type;
- char *name;
- xbt_dict_foreach (root->children_, cursor, name, child_type) {
- recursiveNewUserStateType (father_type, new_typename, child_type);
- }
+ for (auto elm : root->children_)
+ recursiveNewUserStateType(father_type, new_typename, elm.second);
}
void instr_new_user_state_type (const char *father_type, const char *new_typename)
static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color,
simgrid::instr::Type* root)
{
- if (not strcmp(root->name_, type_name)) {
+ if (not strcmp(root->name_, type_name))
simgrid::instr::Value::byNameOrCreate(val, color, root);
- }
- xbt_dict_cursor_t cursor = nullptr;
- simgrid::instr::Type* child_type;
- char *name;
- xbt_dict_foreach (root->children_, cursor, name, child_type) {
- recursiveNewValueForUserStateType(type_name, val, color, child_type);
- }
+
+ for (auto elm : root->children_)
+ 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)