Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Please the checkers (sonar, codacy)
[simgrid.git] / src / s4u / s4u_Link.cpp
index 75d34866cc8f4bfe3fb21bb2eef3cf03455b7195..44742271e19a7c3181e3e121f3696bd23e43c945 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2020. 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. */
@@ -14,6 +14,9 @@
 #include "xbt/log.h"
 
 namespace simgrid {
+
+template class xbt::Extendable<s4u::Link>;
+
 namespace s4u {
 
 xbt::signal<void(Link&)> Link::on_creation;
@@ -52,11 +55,21 @@ double Link::get_latency() const
   return this->pimpl_->get_latency();
 }
 
+void Link::set_latency(double value)
+{
+  kernel::actor::simcall([this, value] { pimpl_->set_latency(value); });
+}
+
 double Link::get_bandwidth() const
 {
   return this->pimpl_->get_bandwidth();
 }
 
+void Link::set_bandwidth(double value)
+{
+  kernel::actor::simcall([this, value] { pimpl_->set_bandwidth(value); });
+}
+
 Link::SharingPolicy Link::get_sharing_policy() const
 {
   return this->pimpl_->get_sharing_policy();
@@ -124,10 +137,20 @@ double sg_link_bandwidth(const_sg_link_t link)
 {
   return link->get_bandwidth();
 }
+
+void sg_link_bandwidth_set(sg_link_t link, double value)
+{
+  return link->set_bandwidth(value);
+}
+
 double sg_link_latency(const_sg_link_t link)
 {
   return link->get_latency();
 }
+void sg_link_latency_set(sg_link_t link, double value)
+{
+  return link->set_latency(value);
+}
 void* sg_link_data(const_sg_link_t link)
 {
   return link->get_data();