Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused typedefs.
[simgrid.git] / src / s4u / s4u_link.cpp
index 60ef3fb..b0de6a6 100644 (file)
@@ -8,6 +8,7 @@
 #include "simgrid/s4u/Link.hpp"
 #include "simgrid/sg_config.h"
 #include "simgrid/simix.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
 #include "src/surf/network_interface.hpp"
 #include "xbt/log.h"
 
@@ -21,7 +22,7 @@ extern "C" {
 
 const char* sg_link_name(sg_link_t link)
 {
-  return link->name();
+  return link->getCname();
 }
 sg_link_t sg_link_by_name(const char* name)
 {
@@ -82,10 +83,18 @@ Link* Link::byName(const char* name)
     return nullptr;
   return &res->piface_;
 }
-const char* Link::name()
+const std::string& Link::getName() const
+{
+  return this->pimpl_->getName();
+}
+const char* Link::getCname() const
 {
   return this->pimpl_->getCname();
 }
+const char* Link::name()
+{
+  return getCname();
+}
 bool Link::isUsed()
 {
   return this->pimpl_->isUsed();
@@ -106,6 +115,11 @@ int Link::sharingPolicy()
   return this->pimpl_->sharingPolicy();
 }
 
+double Link::getUsage()
+{
+  return this->pimpl_->constraint()->get_usage();
+}
+
 void Link::turnOn()
 {
   simgrid::simix::kernelImmediate([this]() {
@@ -149,6 +163,15 @@ void Link::setLatencyTrace(tmgr_trace_t trace)
   });
 }
 
+const char* Link::getProperty(const char* key)
+{
+  return this->pimpl_->getProperty(key);
+}
+void Link::setProperty(std::string key, std::string value)
+{
+  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
+}
+
 /*************
  * Callbacks *
  *************/