X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/617292a9ab55f5ead816de9f867d889f9a20734f..6cc0dc3a9543b27a6f9544f60565abe9e3ab6f3c:/include/simgrid/s4u/Activity.hpp diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index ff9fd78b1f..353fcdbaa0 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -32,10 +32,11 @@ namespace s4u { * That is, activities are all the things that do take time to the actor in the simulated world. */ class XBT_PUBLIC Activity : public xbt::Extendable { +#ifndef DOXYGEN friend Comm; friend Exec; friend Io; -#ifndef DOXYGEN + friend kernel::activity::ActivityImpl; friend std::vector create_DAG_from_dot(const std::string& filename); friend std::vector create_DAG_from_DAX(const std::string& filename); #endif @@ -97,7 +98,9 @@ protected: private: static xbt::signal on_veto; - static xbt::signal on_completion; + static xbt::signal on_completion; + static xbt::signal on_suspended; + static xbt::signal on_resumed; public: /*! Add a callback fired each time that the activity fails to start because of a veto (e.g., unsolved dependency or no @@ -105,6 +108,10 @@ public: static void on_veto_cb(const std::function& cb) { on_veto.connect(cb); } /*! Add a callback fired when the activity completes (either normally, cancelled or failed) */ static void on_completion_cb(const std::function& cb) { on_completion.connect(cb); } + /*! Add a callback fired when the activity is suspended */ + static void on_suspended_cb(const std::function& cb) { on_suspended.connect(cb); } + /*! Add a callback fired when the activity is resumed after being suspended */ + static void on_resumed_cb(const std::function& cb) { on_resumed.connect(cb); } void vetoable_start() { @@ -237,7 +244,6 @@ public: } AnyActivity* set_name(const std::string& name) { - xbt_assert(get_state() == State::INITED, "Cannot change the name of an activity after its start"); name_ = name; return static_cast(this); }