5 #include <boost/type_index.hpp>
6 #include <fc/log/logger.hpp>
18 virtual void apply(ContextType& ctx) = 0;
28 virtual void apply(ContextType&)
33 struct data_service_factory_i;
35 template <
typename ContextType = data_service_factory_i,
36 typename ReentranceGuardType = dummy_reentrance_guard<ContextType>>
46 _after.push_back(std::ref(impl));
51 _before.push_back(std::ref(impl));
57 if (!_guard.is_allowed(ctx))
61 for (
task& r : _after)
66 auto impl = boost::typeindex::type_id_runtime(*this).pretty_name();
70 for (
task& r : _before)
80 using tasks_reqired_type = std::vector<std::reference_wrapper<task>>;
82 tasks_reqired_type _after;
83 tasks_reqired_type _before;
84 ReentranceGuardType _guard;
virtual void apply(ContextType &)
virtual bool is_allowed(ContextType &)
void apply(ContextType &ctx)
task & before(task &impl)
virtual void on_apply(ContextType &)=0
virtual ~task_reentrance_guard_i()
virtual void apply(ContextType &ctx)=0
virtual bool is_allowed(ContextType &ctx)=0