+ void destroy();
+
+ void release_dependencies()
+ {
+ while (not successors_.empty()) {
+ ActivityPtr b = successors_.back();
+ XBT_CVERB(s4u_activity, "Remove a dependency from '%s' on '%s'", get_cname(), b->get_cname());
+ b->dependencies_.erase(this);
+ if (b->dependencies_solved()) {
+ b->start();
+ }
+ successors_.pop_back();
+ }
+ }
+
+ void add_successor(ActivityPtr a)
+ {
+ if(this == a)
+ throw std::invalid_argument("Cannot be its own successor");
+
+ if (std::any_of(begin(successors_), end(successors_), [a](ActivityPtr const& i) { return i.get() == a.get(); }))
+ throw std::invalid_argument("Dependency already exists");
+
+ successors_.push_back(a);
+ a->dependencies_.insert({this});
+ }
+
+ void remove_successor(ActivityPtr a)
+ {
+ if(this == a)
+ throw std::invalid_argument("Cannot ask to remove itself from successors list");
+
+ auto p =
+ std::find_if(successors_.begin(), successors_.end(), [a](ActivityPtr const& i) { return i.get() == a.get(); });
+ if (p == successors_.end())
+ throw std::invalid_argument("Dependency does not exist. Can not be removed.");
+
+ successors_.erase(p);
+ a->dependencies_.erase({this});
+ }
+
+ static std::set<Activity*>* vetoed_activities_;
+
+ /** Set the [remaining] amount of work that this Activity will entail
+ *
+ * It is forbidden to change the amount of work once the Activity is started */
+ Activity* set_remaining(double remains);
+
+ virtual void fire_on_start() const = 0;
+ virtual void fire_on_this_start() const = 0;
+ virtual void fire_on_completion() const = 0;
+ virtual void fire_on_this_completion() 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() = 0;
+ virtual void fire_on_this_veto() = 0;
+