Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
split NetZone and NetZoneImpl as it should in s4u realm
[simgrid.git] / src / s4u / s4u_Engine.cpp
index 330b7ea..e437212 100644 (file)
@@ -263,13 +263,13 @@ void Engine::run()
 /** @brief Retrieve the root netzone, containing all others */
 s4u::NetZone* Engine::get_netzone_root()
 {
-  return pimpl->netzone_root_;
+  return pimpl->netzone_root_->get_iface();
 }
 /** @brief Set the root netzone, containing all others. Once set, it cannot be changed. */
 void Engine::set_netzone_root(s4u::NetZone* netzone)
 {
   xbt_assert(pimpl->netzone_root_ == nullptr, "The root NetZone cannot be changed once set");
-  pimpl->netzone_root_ = static_cast<kernel::routing::NetZoneImpl*>(netzone);
+  pimpl->netzone_root_ = netzone->get_impl();
 }
 
 static s4u::NetZone* netzone_by_name_recursive(s4u::NetZone* current, const char* name)
@@ -277,7 +277,7 @@ static s4u::NetZone* netzone_by_name_recursive(s4u::NetZone* current, const char
   if (not strcmp(current->get_cname(), name))
     return current;
 
-  for (auto const& elem : *(current->get_children())) {
+  for (auto const& elem : current->get_children()) {
     simgrid::s4u::NetZone* tmp = netzone_by_name_recursive(elem, name);
     if (tmp != nullptr) {
       return tmp;