From: Martin Quinson Date: Sun, 31 Jan 2016 00:38:46 +0000 (+0100) Subject: Simplifies the prototype of the surf::Link::onStateChange signal X-Git-Tag: v3_13~1026 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/00f6ad540f2098d7c324e11bacc1ac503b680918?hp=f159a7002798e65df6c90c3b9f774f48920aa41b Simplifies the prototype of the surf::Link::onStateChange signal --- diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 0996ae36b8..14cde62b76 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -97,7 +97,7 @@ void Link::linksExit() { simgrid::xbt::signal Link::onCreation; simgrid::xbt::signal Link::onDestruction; -simgrid::xbt::signal Link::onStateChange; // signature: wasOn, currentlyOn +simgrid::xbt::signal Link::onStateChange; simgrid::xbt::signal networkActionStateChangedCallbacks; simgrid::xbt::signal networkCommunicateCallbacks; @@ -254,13 +254,13 @@ int Link::sharingPolicy() void Link::turnOn(){ if (isOff()) { Resource::turnOn(); - onStateChange(this, 0, 1); + onStateChange(this); } } void Link::turnOff(){ if (isOn()) { Resource::turnOff(); - onStateChange(this, 1, 0); + onStateChange(this); } } diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index 5e26f23832..0ead107f0f 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -211,9 +211,9 @@ public: * Signature: void(Link*) */ static simgrid::xbt::signal onDestruction; - /** @brief Callback signal fired when the state of a Link changes - * Signature: `void(LinkAction *action, int previouslyOn, int currentlyOn)` */ - static simgrid::xbt::signal onStateChange; + /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off) + * Signature: `void(Link*)` */ + static simgrid::xbt::signal onStateChange; /** @brief Get the bandwidth in bytes per second of current Link */