X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7672ae43c2b49a7dcdc0976cc89a05cc87ae534c..417ed3b671abe3a71fa4106d23d0a432084cc207:/src/s4u/s4u_Link.cpp diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index a35cd13012..8d41270893 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2023. 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. */ @@ -82,8 +82,7 @@ Link* Link::set_latency(const std::string& value) try { d_value = xbt_parse_get_time("", 0, value, ""); } catch (const simgrid::ParseError&) { - throw std::invalid_argument(std::string("Impossible to set latency for link: ") + get_name() + - std::string(". Invalid value: ") + value); + throw std::invalid_argument("Impossible to set latency for link: " + get_name() + ". Invalid value: " + value); } return set_latency(d_value); } @@ -102,8 +101,8 @@ Link* Link::set_bandwidth(double value) Link* Link::set_sharing_policy(Link::SharingPolicy policy, const NonLinearResourceCb& cb) { if (policy == SharingPolicy::SPLITDUPLEX || policy == SharingPolicy::WIFI) - throw std::invalid_argument(std::string("Impossible to set wifi or split-duplex for the link: ") + get_name() + - std::string(". Use appropriate create function in NetZone.")); + throw std::invalid_argument("Impossible to set wifi or split-duplex for the link: " + get_name() + + ". Use appropriate create function in NetZone."); kernel::actor::simcall_object_access(pimpl_, [this, policy, &cb] { pimpl_->set_sharing_policy(policy, cb); }); return this; @@ -120,6 +119,11 @@ void Link::set_host_wifi_rate(const s4u::Host* host, int level) const wlink->set_host_rate(host, level); } +int Link::get_concurrency_limit() const +{ + return pimpl_->get_concurrency_limit(); +} + Link* Link::set_concurrency_limit(int limit) { kernel::actor::simcall_object_access(pimpl_, [this, limit] { pimpl_->set_concurrency_limit(limit); });