X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3a403e463ecccd4a15bbf4aeb05c860fdd7c5db1..1363ce9624f4327f3ad5c934b15736a776637dfd:/include/simgrid/s4u/Disk.hpp diff --git a/include/simgrid/s4u/Disk.hpp b/include/simgrid/s4u/Disk.hpp index fcba914a0f..eec006c2f6 100644 --- a/include/simgrid/s4u/Disk.hpp +++ b/include/simgrid/s4u/Disk.hpp @@ -133,17 +133,35 @@ public: Disk* seal(); /* The signals */ - /** @brief Add a callback fired when a new Disk is created */ + /** @brief \static Add a callback fired when a new Disk is created */ static void on_creation_cb(const std::function& cb) { on_creation.connect(cb); } - /** @brief Add a callback fired when a Disk is destroyed */ + /** @brief \static Add a callback fired when any Disk is destroyed */ static void on_destruction_cb(const std::function& cb) { on_destruction.connect(cb); } - /** @brief Add a callback fired when a Disk's state changes */ - static void on_state_change_cb(const std::function& cb) { on_state_change.connect(cb); } + /** @brief Add a callback fired when this specific Disk is destroyed */ + void on_this_destruction_cb(const std::function& cb) { on_this_destruction.connect(cb); } + /** @brief \static Add a callback fired when any Disk is turned on or off */ + static void on_onoff_cb(const std::function& cb) + { + on_onoff.connect(cb); + } + /** @brief Add a callback fired when this specific Disk is turned on or off */ + void on_this_onoff_cb(const std::function& cb) + { + on_this_onoff.connect(cb); + } + + XBT_ATTRIB_DEPRECATED_v338("Please use on_onoff_cb() instead") static void on_state_change_cb( + const std::function& cb) + { + on_onoff.connect(cb); + } private: static xbt::signal on_creation; static xbt::signal on_destruction; - static xbt::signal on_state_change; + xbt::signal on_this_destruction; + static xbt::signal on_onoff; + xbt::signal on_this_onoff; }; } // namespace s4u