Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a reference for ExecImpl::wait_any_for()'s vector.
[simgrid.git] / src / s4u / s4u_Netzone.cpp
index 4111435..4f97b64 100644 (file)
@@ -47,9 +47,9 @@ std::vector<NetZone*> NetZone::get_children() const
   return res;
 }
 
-NetZone* NetZone::add_child(const NetZone* new_zone)
+NetZone* NetZone::add_child(NetZone* new_zone)
 {
-  pimpl_->add_child(new_zone->get_impl());
+  new_zone->set_parent(this);
   return this;
 }
 
@@ -75,7 +75,7 @@ NetZone* NetZone::get_parent() const
 
 NetZone* NetZone::set_parent(const NetZone* parent)
 {
-  pimpl_->set_parent(parent->get_impl());
+  kernel::actor::simcall([this, parent] { pimpl_->set_parent(parent->get_impl()); });
   return this;
 }
 
@@ -143,9 +143,10 @@ void NetZone::extract_xbt_graph(const s_xbt_graph_t* graph, std::map<std::string
   pimpl_->get_graph(graph, nodes, edges);
 }
 
-void NetZone::seal()
+NetZone* NetZone::seal()
 {
   kernel::actor::simcall([this] { pimpl_->seal(); });
+  return this;
 }
 
 s4u::Host* NetZone::create_host(const std::string& name, const std::vector<double>& speed_per_pstate)