X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f00b09c7ebfa3b4e12c96c764ee7a0e0e07ec20..24eff0b164b2560dd2a6237573213fbc944cde64:/include/simgrid/s4u/Io.hpp diff --git a/include/simgrid/s4u/Io.hpp b/include/simgrid/s4u/Io.hpp index 8c626f774c..a773d0c4ab 100644 --- a/include/simgrid/s4u/Io.hpp +++ b/include/simgrid/s4u/Io.hpp @@ -11,8 +11,7 @@ #include -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { /** I/O Activity, representing the asynchronous disk access. * @@ -25,16 +24,23 @@ class XBT_PUBLIC Io : public Activity_T { friend kernel::EngineImpl; #endif - static xbt::signal on_start; + inline static xbt::signal on_start; + xbt::signal on_this_start; protected: explicit Io(kernel::activity::IoImplPtr pimpl); Io* do_start() override; + void fire_on_completion() const override { on_completion(*this); } + void fire_on_this_completion() const override { on_this_completion(*this); } + void fire_on_veto() const override { on_veto(const_cast(*this)); } + void fire_on_suspend() const override { on_suspend(*this); } + void fire_on_resume() const override { on_resume(*this); } public: enum class OpType { READ, WRITE }; static void on_start_cb(const std::function& cb) { on_start.connect(cb); } + void on_this_start_cb(const std::function& cb) { on_this_start.connect(cb); } static IoPtr init(); /*! take a vector of s4u::IoPtr and return when one of them is finished. @@ -64,7 +70,6 @@ public: bool is_assigned() const override; }; -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u #endif /* SIMGRID_S4U_IO_HPP */