X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e526ad06508e0193155f0591b43d7d9e9e92f6c7..929bbf2f78b5c0151713d61bf5b163943b8b9343:/src/s4u/s4u_link.cpp diff --git a/src/s4u/s4u_link.cpp b/src/s4u/s4u_link.cpp index 60ef3fba7f..c374d07641 100644 --- a/src/s4u/s4u_link.cpp +++ b/src/s4u/s4u_link.cpp @@ -8,6 +8,7 @@ #include "simgrid/s4u/Link.hpp" #include "simgrid/sg_config.h" #include "simgrid/simix.hpp" +#include "src/surf/maxmin_private.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 * *************/