+
+s4u::Link* NetZone::create_link(const std::string& name, const std::vector<double>& bandwidths,
+ s4u::Link::SharingPolicy policy)
+{
+ return kernel::actor::simcall(
+ [this, &name, &bandwidths, &policy] { return pimpl_->create_link(name, bandwidths, policy); });
+}
+
+s4u::Link* NetZone::create_link(const std::string& name, const std::vector<std::string>& bandwidths,
+ s4u::Link::SharingPolicy policy)
+{
+ std::vector<double> bw;
+ bw.reserve(bandwidths.size());
+ for (const auto& speed_str : bandwidths) {
+ try {
+ double speed = xbt_parse_get_bandwidth("", 0, speed_str.c_str(), nullptr, "");
+ bw.push_back(speed);
+ } catch (const simgrid::ParseError&) {
+ xbt_die("Link: Impossible to create_link, invalid bandwidth %s", speed_str.c_str());
+ }
+ }
+ return create_link(name, bw, policy);
+}
+