+ 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;
+
+ /** Add a callback fired before an operation activity start.
+ * Triggered after the on_this_start function**/
+ static void on_start_cb(const std::function<void(Operation*)>& cb) { on_start.connect(cb); }
+ /** Add a callback fired after an operation activity end.
+ * Triggered after the on_this_end function, but before
+ * sending tokens to successors.**/
+ static void on_end_cb(const std::function<void(Operation*)>& cb) { on_end.connect(cb); }
+
+#ifndef DOXYGEN
+ friend void intrusive_ptr_release(Operation* o)
+ {
+ if (o->refcount_.fetch_sub(1, std::memory_order_release) == 1) {
+ std::atomic_thread_fence(std::memory_order_acquire);
+ delete o;
+ }
+ }
+ friend void intrusive_ptr_add_ref(Operation* o) { o->refcount_.fetch_add(1, std::memory_order_relaxed); }
+#endif