container_name2container.insert({this->name, this});
}
-Container::~Container()
-{
- for (auto const& child : this->children)
- delete child;
-}
-
void Container::add_child(jed_container_t child)
{
xbt_assert(child != nullptr);
- this->children.push_back(child);
+ this->children.emplace_back(child);
child->parent = this;
}
int child_nb = -1;
for (auto const& child : this->parent->children) {
- if( child == this) {
+ if (child.get() == this) {
child_nb = i;
break;
}