X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/afd2ff03984f505acd352509ee102f086e0374a3..576680fc0cbe8a97b0e439c0db295b23f5f8816c:/src/s4u/s4u_link.cpp diff --git a/src/s4u/s4u_link.cpp b/src/s4u/s4u_link.cpp index 66351429ac..dcac704643 100644 --- a/src/s4u/s4u_link.cpp +++ b/src/s4u/s4u_link.cpp @@ -9,6 +9,7 @@ #include "simgrid/sg_config.h" #include "simgrid/simix.hpp" #include "src/surf/network_interface.hpp" +#include "surf/maxmin.hpp" #include "xbt/log.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U links"); @@ -90,6 +91,10 @@ const char* Link::getCname() const { return this->pimpl_->getCname(); } +const char* Link::name() +{ + return getCname(); +} bool Link::isUsed() { return this->pimpl_->isUsed(); @@ -110,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]() { @@ -153,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 * *************/