+/** @ingroup plugin_operation
+ * @param func The function to set.
+ * @brief Set a function to be called before each execution.
+ * @note The function is called before the underlying Activity starts.
+ */
+void Operation::on_this_start(std::function<void(Operation*)> func)
+{
+ simgrid::kernel::actor::simcall_answered([this, func] { start_func_ = func; });
+}
+
+/** @ingroup plugin_operation
+ * @param func The function to set.
+ * @brief Set a function to be called after each execution.
+ * @note The function is called after the underlying Activity ends, but before sending tokens to successors.
+ */
+void Operation::on_this_end(std::function<void(Operation*)> func)
+{
+ simgrid::kernel::actor::simcall_answered([this, func] { end_func_ = func; });
+}
+
+/** @ingroup plugin_operation
+ * @brief Return the number of completed executions.
+ */
+int Operation::get_count()
+{
+ return count_;
+}
+
+/**
+ * @brief Default constructor.
+ */