1 #ifndef ERROR_HANDLER_MA_ACTION_H
2 #define ERROR_HANDLER_MA_ACTION_H
8 #include "ErrorHandler/MessageAnalyzer/ma_types.h"
10 #include <fhiclcpp/ParameterSet.h>
12 #include <boost/any.hpp>
13 #include <boost/function.hpp>
16 namespace errorhandler {
21 typedef std::vector<boost::any> anys_t;
22 typedef fhicl::ParameterSet pset_t;
29 : parent_rule(*rule), parameter(pset) {}
32 virtual bool exec() = 0;
41 typedef std::vector<ma_action *> ma_actions;
43 typedef boost::function<ma_action *(ma_rule const *, pset_t const &)> gen_act_t;
47 typedef std::map<std::string, gen_act_t> gen_map_t;
51 reg(std::string
const &action_name, gen_act_t f);
54 create_instance(std::string
const &act_name,
ma_rule const *rule, pset_t
const &pset);
71 ma_action_factory::reg(act_name, f);
81 #define REG_MA_ACTION(act_name, class_name) \
83 class_name##_maker_func(ma_rule const *r, fhicl::ParameterSet const &p) \
85 return new class_name(r, p); \
88 class_name##_maker_func_global_var(#act_name, class_name##_maker_func);
base class - all customized fucntions are inherited from it