double get_amount() const { return amount_; }
void add_successor(OperationPtr op);
void remove_successor(OperationPtr op);
+ void remove_all_successors();
+ const std::set<Operation*>& get_successors() const { return successors_ ;}
void on_this_start(const std::function<void(Operation*)>& func);
void on_this_end(const std::function<void(Operation*)>& func);
int get_count() const;
successor->remove_predecessor(this);
}
+void Operation::remove_all_successors()
+{
+ simgrid::kernel::actor::simcall_answered([this] {
+ while (not successors_.empty()) {
+ auto* successor = *(successors_.begin());
+ successor->predecessors_.erase(this);
+ successors_.erase(successor);
+ }
+ });
+}
+
/** @ingroup plugin_operation
* @param func The function to set.
* @brief Set a function to be called before each execution.