Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix tracing debug mode (and please sonar)
[simgrid.git] / src / s4u / s4u_Engine.cpp
index 352e4eb..5860786 100644 (file)
@@ -193,6 +193,12 @@ s4u::NetZone* Engine::get_netzone_root()
 {
   return pimpl->netzone_root_;
 }
+/** @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);
+}
 
 static s4u::NetZone* netzone_by_name_recursive(s4u::NetZone* current, const char* name)
 {