X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ba43262d5e3a9752bc0decba403c8c7d4f5e71f2..b3de1128eda444865a2de3fc774a35367e6eaf08:/include/simgrid/s4u/Activity.hpp diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index 506926b511..820445887b 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -106,11 +106,12 @@ protected: virtual void fire_on_completion() const = 0; virtual void fire_on_this_completion() const = 0; - virtual void fire_on_veto() const = 0; virtual void fire_on_suspend() const = 0; virtual void fire_on_this_suspend() const = 0; virtual void fire_on_resume() const = 0; virtual void fire_on_this_resume() const = 0; + virtual void fire_on_veto() const = 0; + virtual void fire_on_this_veto() const = 0; public: XBT_ATTRIB_DEPRECATED_v334("All start() are vetoable now. Please use start() ") void vetoable_start() @@ -127,6 +128,7 @@ public: if (vetoed_activities_ != nullptr) vetoed_activities_->insert(this); fire_on_veto(); + fire_on_this_veto(); } } @@ -238,25 +240,27 @@ template class Activity_T : public Activity { protected: inline static xbt::signal on_completion; xbt::signal on_this_completion; - inline static xbt::signal on_veto; inline static xbt::signal on_suspend; xbt::signal on_this_suspend; inline static xbt::signal on_resume; xbt::signal on_this_resume; + inline static xbt::signal on_veto; + xbt::signal on_this_veto; public: /*! 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); } void on_this_completion_cb(const std::function& cb) { on_this_completion.connect(cb); } - /*! Add a callback fired each time that the activity fails to start because of a veto (e.g., unsolved dependency or no - * resource assigned) */ - static void on_veto_cb(const std::function& cb) { on_veto.connect(cb); } /*! Add a callback fired when the activity is suspended */ static void on_suspend_cb(const std::function& cb) { on_suspend.connect(cb); } void on_this_suspend_cb(const std::function& cb) { on_this_suspend.connect(cb); } /*! Add a callback fired when the activity is resumed after being suspended */ static void on_resume_cb(const std::function& cb) { on_resume.connect(cb); } void on_this_resume_cb(const std::function& cb) { on_this_resume.connect(cb); } + /*! Add a callback fired each time that the activity fails to start because of a veto (e.g., unsolved dependency or no + * resource assigned) */ + static void on_veto_cb(const std::function& cb) { on_veto.connect(cb); } + void on_this_veto_cb(const std::function& cb) { on_this_veto.connect(cb); } XBT_ATTRIB_DEPRECATED_v337("Please use on_suspend_cb() instead") static void on_suspended_cb( const std::function& cb) { on_suspend.connect(cb); }