]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/resource/StandardLinkImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename VM signals to distinguish them from Host::on_creation/on_destruction.
[simgrid.git] / src / kernel / resource / StandardLinkImpl.cpp
index 4cc2b76d5caa0156de721678dcd5dfd1ec9c7be9..6648c23d4528b096377140bd1cc1de788f3b6bd6 100644 (file)
@@ -15,19 +15,21 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
  * Model *
  *********/
 
-namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace simgrid::kernel::resource {
 
 StandardLinkImpl::StandardLinkImpl(const std::string& name) : LinkImpl(name), piface_(this)
 {
   if (name != "__loopback__")
     xbt_assert(not s4u::Link::by_name_or_null(name), "Link '%s' declared several times in the platform.", name.c_str());
 
-  s4u::Engine::get_instance()->link_register(name, &piface_);
   XBT_DEBUG("Create link '%s'", name.c_str());
 }
 
+void StandardLinkImpl::Deleter::operator()(resource::StandardLinkImpl* link) const
+{
+  link->destroy();
+}
+
 /** @brief Fire the required callbacks and destroy the object
  *
  * Don't delete directly a Link, call l->destroy() instead.
@@ -35,7 +37,6 @@ StandardLinkImpl::StandardLinkImpl(const std::string& name) : LinkImpl(name), pi
 void StandardLinkImpl::destroy()
 {
   s4u::Link::on_destruction(piface_);
-  s4u::Engine::get_instance()->link_unregister(get_name());
   delete this;
 }
 
@@ -68,6 +69,12 @@ void StandardLinkImpl::latency_check(double latency) const
   }
 }
 
+StandardLinkImpl* StandardLinkImpl::set_englobing_zone(routing::NetZoneImpl* englobing_zone)
+{
+  englobing_zone_ = englobing_zone;
+  return this;
+}
+
 void StandardLinkImpl::turn_on()
 {
   if (not is_on()) {
@@ -132,6 +139,4 @@ void StandardLinkImpl::set_concurrency_limit(int limit) const
   get_constraint()->set_concurrency_limit(limit);
 }
 
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::resource