1 #ifndef ERROR_HANDLER_MA_FUNCTION_H
2 #define ERROR_HANDLER_MA_FUNCTION_H
8 #include "ErrorHandler/MessageAnalyzer/ma_types.h"
10 #include <boost/any.hpp>
11 #include <boost/function.hpp>
14 namespace errorhandler {
18 typedef std::vector<boost::any> anys_t;
52 evaluate(
ma_condition const& cond, ma_cond_domain dom) = 0;
65 parse_arguments(anys_t
const& ) {
return true; }
80 grouped_alarm() {
return true; }
86 typedef boost::function<ma_function*()> gen_func_t;
90 typedef std::map<std::string, gen_func_t> gen_map_t;
94 reg(std::string
const& func_name, gen_func_t f);
97 create_instance(std::string
const& func_name);
105 static gen_map_t map;
114 ma_function_factory::reg(func_name, f);
124 #define REG_MA_FUNCTION(func_name, class_name) \
126 class_name##_maker_func() { return new class_name(); } \
128 class_name##_maker_func_global_var(#func_name, class_name##_maker_func);