Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
CommWaitTransition mailbox is now valid
[simgrid.git] / src / s4u / s4u_Link.cpp
index 83919625a353a5fd38b2cc9240afe2db003d496b..ff36c714b72c8e80c929afa252500182090af025 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -10,9 +10,9 @@
 #include <xbt/config.hpp>
 #include <xbt/parse_units.hpp>
 
-#include "src/surf/SplitDuplexLinkImpl.hpp"
-#include "src/surf/network_interface.hpp"
-#include "src/surf/network_wifi.hpp"
+#include "src/kernel/resource/LinkImpl.hpp"
+#include "src/kernel/resource/SplitDuplexLinkImpl.hpp"
+#include "src/kernel/resource/WifiLinkImpl.hpp"
 
 namespace simgrid {
 
@@ -32,9 +32,9 @@ Link* Link::by_name(const std::string& name)
   return Engine::get_instance()->link_by_name(name);
 }
 
-kernel::resource::LinkImpl* Link::get_impl() const
+kernel::resource::StandardLinkImpl* Link::get_impl() const
 {
-  auto* link_impl = dynamic_cast<kernel::resource::LinkImpl*>(pimpl_);
+  auto* link_impl = dynamic_cast<kernel::resource::StandardLinkImpl*>(pimpl_);
   xbt_assert(link_impl != nullptr, "Impossible to get a LinkImpl* from link. %s.",
              (get_sharing_policy() == SharingPolicy::SPLITDUPLEX
                   ? "For a Split-Duplex link, you should call this method to each UP/DOWN member"
@@ -115,7 +115,7 @@ Link::SharingPolicy Link::get_sharing_policy() const
 
 void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
 {
-  auto* wlink = dynamic_cast<kernel::resource::NetworkWifiLink*>(pimpl_);
+  auto* wlink = dynamic_cast<kernel::resource::WifiLinkImpl*>(pimpl_);
   xbt_assert(wlink != nullptr, "Link %s does not seem to be a wifi link.", get_cname());
   wlink->set_host_rate(host, level);
 }
@@ -254,7 +254,7 @@ void sg_link_set_latency(sg_link_t link, double value)
 
 void* sg_link_get_data(const_sg_link_t link)
 {
-  return link->get_data();
+  return link->get_data<void>();
 }
 
 void sg_link_set_data(sg_link_t link, void* data)