A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
transitions in the same actor are dependent
[simgrid.git]
/
src
/
s4u
/
s4u_Link.cpp
diff --git
a/src/s4u/s4u_Link.cpp
b/src/s4u/s4u_Link.cpp
index a949b72b9f676326f144aaf2da922c0bf9ff0fce..8d41270893b07a0850fac3f59c4334acf7b2807b 100644
(file)
--- a/
src/s4u/s4u_Link.cpp
+++ b/
src/s4u/s4u_Link.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2013-202
1
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-202
3
. 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. */
/* 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. */
@@
-72,7
+72,7
@@
double Link::get_latency() const
Link* Link::set_latency(double value)
{
Link* Link::set_latency(double value)
{
- kernel::actor::simcall
(
[this, value] { pimpl_->set_latency(value); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, value] { pimpl_->set_latency(value); });
return this;
}
return this;
}
@@
-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&) {
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);
}
}
return set_latency(d_value);
}
@@
-95,17
+94,17
@@
double Link::get_bandwidth() const
Link* Link::set_bandwidth(double value)
{
Link* Link::set_bandwidth(double value)
{
- kernel::actor::simcall
(
[this, value] { pimpl_->set_bandwidth(value); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, value] { pimpl_->set_bandwidth(value); });
return this;
}
Link* Link::set_sharing_policy(Link::SharingPolicy policy, const NonLinearResourceCb& cb)
{
if (policy == SharingPolicy::SPLITDUPLEX || policy == SharingPolicy::WIFI)
return this;
}
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
(
[this, policy, &cb] { pimpl_->set_sharing_policy(policy, cb); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, policy, &cb] { pimpl_->set_sharing_policy(policy, cb); });
return this;
}
Link::SharingPolicy Link::get_sharing_policy() const
return this;
}
Link::SharingPolicy Link::get_sharing_policy() const
@@
-120,9
+119,14
@@
void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
wlink->set_host_rate(host, level);
}
wlink->set_host_rate(host, level);
}
+int Link::get_concurrency_limit() const
+{
+ return pimpl_->get_concurrency_limit();
+}
+
Link* Link::set_concurrency_limit(int limit)
{
Link* Link::set_concurrency_limit(int limit)
{
- kernel::actor::simcall
(
[this, limit] { pimpl_->set_concurrency_limit(limit); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, limit] { pimpl_->set_concurrency_limit(limit); });
return this;
}
return this;
}
@@
-133,15
+137,15
@@
double Link::get_usage() const
void Link::turn_on()
{
void Link::turn_on()
{
- kernel::actor::simcall([this]() { this->pimpl_->turn_on(); });
+ kernel::actor::simcall
_answered
([this]() { this->pimpl_->turn_on(); });
}
void Link::turn_off()
{
}
void Link::turn_off()
{
- kernel::actor::simcall([this]() { this->pimpl_->turn_off(); });
+ kernel::actor::simcall
_answered
([this]() { this->pimpl_->turn_off(); });
}
Link* Link::seal()
{
}
Link* Link::seal()
{
- kernel::actor::simcall([this]() { this->pimpl_->seal(); });
+ kernel::actor::simcall
_answered
([this]() { this->pimpl_->seal(); });
s4u::Link::on_creation(*this); // notify the signal
return this;
}
s4u::Link::on_creation(*this); // notify the signal
return this;
}
@@
-154,21
+158,21
@@
bool Link::is_on() const
Link* Link::set_state_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a state profile once the Link is sealed");
Link* Link::set_state_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a state profile once the Link is sealed");
- kernel::actor::simcall
(
[this, profile]() { this->pimpl_->set_state_profile(profile); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, profile]() { this->pimpl_->set_state_profile(profile); });
return this;
}
Link* Link::set_bandwidth_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a bandwidth profile once the Link is sealed");
return this;
}
Link* Link::set_bandwidth_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a bandwidth profile once the Link is sealed");
- kernel::actor::simcall
(
[this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
return this;
}
Link* Link::set_latency_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a latency profile once the Link is sealed");
return this;
}
Link* Link::set_latency_profile(kernel::profile::Profile* profile)
{
xbt_assert(not pimpl_->is_sealed(), "Cannot set a latency profile once the Link is sealed");
- kernel::actor::simcall
(
[this, profile]() { this->pimpl_->set_latency_profile(profile); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, profile]() { this->pimpl_->set_latency_profile(profile); });
return this;
}
return this;
}
@@
-178,7
+182,7
@@
const char* Link::get_property(const std::string& key) const
}
Link* Link::set_property(const std::string& key, const std::string& value)
{
}
Link* Link::set_property(const std::string& key, const std::string& value)
{
- kernel::actor::simcall
(
[this, &key, &value] { this->pimpl_->set_property(key, value); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, &key, &value] { this->pimpl_->set_property(key, value); });
return this;
}
return this;
}
@@
-189,7
+193,7
@@
const std::unordered_map<std::string, std::string>* Link::get_properties() const
Link* Link::set_properties(const std::unordered_map<std::string, std::string>& properties)
{
Link* Link::set_properties(const std::unordered_map<std::string, std::string>& properties)
{
- kernel::actor::simcall
(
[this, &properties] { this->pimpl_->set_properties(properties); });
+ kernel::actor::simcall
_object_access(pimpl_,
[this, &properties] { this->pimpl_->set_properties(properties); });
return this;
}
return this;
}
@@
-254,7
+258,7
@@
void sg_link_set_latency(sg_link_t link, double value)
void* sg_link_get_data(const_sg_link_t link)
{
void* sg_link_get_data(const_sg_link_t link)
{
- return link->get_data();
+ return link->get_data
<void>
();
}
void sg_link_set_data(sg_link_t link, void* data)
}
void sg_link_set_data(sg_link_t link, void* data)