X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/708a8a1d135e6fefa46fcb806568dd7549305669..206a2b027325f16558bdf3f673da223a8a4921d4:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index cd0cc7e4fe..bfcf4cee95 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -72,12 +72,13 @@ xbt::signalget_netzone_root()) { - s4u::Engine::get_instance()->set_netzone_root(&piface_); + if (not engine->get_netzone_root()) { + engine->set_netzone_root(&piface_); /* root netzone set, initialize models */ simgrid::s4u::Engine::on_platform_creation(); @@ -91,10 +92,10 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name) surf_config_models_setup(); } - xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), + xbt_assert(nullptr == engine->netpoint_by_name_or_null(get_name()), "Refusing to create a second NetZone called '%s'.", get_cname()); netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone); - XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id()); + XBT_DEBUG("NetZone '%s' created with the id '%lu'", get_cname(), netpoint_->id()); _sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent * any further config now that we created some real content */ simgrid::s4u::NetZone::on_creation(piface_); // notify the signal @@ -195,7 +196,8 @@ NetPoint* NetZoneImpl::create_router(const std::string& name) return (new NetPoint(name, NetPoint::Type::Router))->set_englobing_zone(this); } -int NetZoneImpl::add_component(NetPoint* elm) + +unsigned long NetZoneImpl::add_component(NetPoint* elm) { vertices_.push_back(elm); return vertices_.size() - 1; // The rank of the newly created object