X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/82230d737404aa70c3c2b5824d97109f1f129d58..0617119206ff65bfdad4e484f653638abbc3c747:/src/s4u/s4u_link.cpp?ds=sidebyside diff --git a/src/s4u/s4u_link.cpp b/src/s4u/s4u_link.cpp index 7a38166c10..d9a5089527 100644 --- a/src/s4u/s4u_link.cpp +++ b/src/s4u/s4u_link.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2018. 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. */ @@ -6,8 +6,9 @@ #include #include "simgrid/s4u/Link.hpp" -#include "simgrid/sg_config.h" +#include "simgrid/sg_config.hpp" #include "simgrid/simix.hpp" +#include "src/kernel/lmm/maxmin.hpp" #include "src/surf/network_interface.hpp" #include "xbt/log.h" @@ -17,11 +18,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U link * C API * *********/ -extern "C" { - const char* sg_link_name(sg_link_t link) { - return link->getCname(); + return link->get_cname(); } sg_link_t sg_link_by_name(const char* name) { @@ -67,7 +66,6 @@ void sg_link_exit() { simgrid::surf::LinkImpl::linksExit(); } -} /*********** * C++ API * @@ -82,21 +80,21 @@ Link* Link::byName(const char* name) return nullptr; return &res->piface_; } -const std::string& Link::getName() const +const std::string& Link::get_name() const { - return this->pimpl_->getName(); + return this->pimpl_->get_name(); } -const char* Link::getCname() const +const char* Link::get_cname() const { - return this->pimpl_->getCname(); + return this->pimpl_->get_cname(); } const char* Link::name() { - return getCname(); + return get_cname(); } bool Link::isUsed() { - return this->pimpl_->isUsed(); + return this->pimpl_->is_used(); } double Link::latency() @@ -116,20 +114,16 @@ int Link::sharingPolicy() double Link::getUsage() { - return lmm_constraint_get_usage(this->pimpl_->constraint()); + return this->pimpl_->get_constraint()->get_usage(); } void Link::turnOn() { - simgrid::simix::kernelImmediate([this]() { - this->pimpl_->turnOn(); - }); + simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_on(); }); } void Link::turnOff() { - simgrid::simix::kernelImmediate([this]() { - this->pimpl_->turnOff(); - }); + simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_off(); }); } void* Link::getData()