From ead116337e0f3636ea2bcb200cd5156e576689eb Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 13 Feb 2017 23:17:45 +0100 Subject: [PATCH] align the Link callbacks with the ones of Host --- include/simgrid/s4u/Link.hpp | 6 +++--- src/s4u/s4u_link.cpp | 6 +++--- src/surf/instr_routing.cpp | 8 ++++---- src/surf/network_cm02.cpp | 2 +- src/surf/network_interface.cpp | 6 +++--- src/surf/ptask_L07.cpp | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index af44cb4dcf..8c2a9f4def 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -70,13 +70,13 @@ public: /* The signals */ /** @brief Callback signal fired when a new Link is created */ - static simgrid::xbt::signal onCreation; + static simgrid::xbt::signal onCreation; /** @brief Callback signal fired when a Link is destroyed */ - static simgrid::xbt::signal onDestruction; + static simgrid::xbt::signal onDestruction; /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off) */ - static simgrid::xbt::signal onStateChange; + static simgrid::xbt::signal onStateChange; /** @brief Callback signal fired when a communication starts */ static simgrid::xbt::signal onCommunicate; diff --git a/src/s4u/s4u_link.cpp b/src/s4u/s4u_link.cpp index 3f719e5df7..4fd78e8863 100644 --- a/src/s4u/s4u_link.cpp +++ b/src/s4u/s4u_link.cpp @@ -152,9 +152,9 @@ void Link::setLatencyTrace(tmgr_trace_t trace) /************* * Callbacks * *************/ -simgrid::xbt::signal Link::onCreation; -simgrid::xbt::signal Link::onDestruction; -simgrid::xbt::signal Link::onStateChange; +simgrid::xbt::signal Link::onCreation; +simgrid::xbt::signal Link::onDestruction; +simgrid::xbt::signal Link::onStateChange; simgrid::xbt::signal Link::onCommunicate; simgrid::xbt::signal Link::onCommunicationStateChange; } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 00b25553d1..bc6274b4d3 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -206,16 +206,16 @@ void sg_instr_AS_end() } } -static void instr_routing_parse_start_link(simgrid::surf::LinkImpl* link) +static void instr_routing_parse_start_link(simgrid::s4u::Link& link) { if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback? return; container_t father = currentContainer.back(); - double bandwidth_value = link->bandwidth(); - double latency_value = link->latency(); + double bandwidth_value = link.bandwidth(); + double latency_value = link.latency(); - container_t container = PJ_container_new(link->cname(), INSTR_LINK, father); + container_t container = PJ_container_new(link.name(), INSTR_LINK, father); if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) { type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 51b26dac50..ace3af873e 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -401,7 +401,7 @@ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, doub if (policy == SURF_LINK_FATPIPE) lmm_constraint_shared(constraint()); - simgrid::s4u::Link::onCreation(this); + simgrid::s4u::Link::onCreation(this->piface_); } void NetworkCm02Link::apply_event(tmgr_trace_iterator_t triggered, double value) diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 7f1e590ef7..0414e74bb5 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -126,7 +126,7 @@ namespace simgrid { { if (!currentlyDestroying_) { currentlyDestroying_ = true; - s4u::Link::onDestruction(this); + s4u::Link::onDestruction(this->piface_); delete this; } } @@ -155,14 +155,14 @@ namespace simgrid { { if (isOff()) { Resource::turnOn(); - s4u::Link::onStateChange(this); + s4u::Link::onStateChange(this->piface_); } } void LinkImpl::turnOff() { if (isOn()) { Resource::turnOff(); - s4u::Link::onStateChange(this); + s4u::Link::onStateChange(this->piface_); } } void LinkImpl::setStateTrace(tmgr_trace_t trace) diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 8e90e0618d..e691b00a04 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -273,7 +273,7 @@ LinkL07::LinkL07(NetworkL07Model* model, const char* name, double bandwidth, dou if (policy == SURF_LINK_FATPIPE) lmm_constraint_shared(constraint()); - s4u::Link::onCreation(this); + s4u::Link::onCreation(this->piface_); } Action *CpuL07::execution_start(double size) -- 2.20.1