artdaq_mfextensions  v1_06_02
ma_action.cpp
1 
2 #include "ErrorHandler/MessageAnalyzer/ma_action.h"
3 
4 using namespace novadaq::errorhandler;
5 
6 // ma_function class
7 
8 // ma_function_factory
9 
10 void ma_action_factory::reg(std::string const& func_name, gen_act_t f)
11 {
12  get_map().insert(std::make_pair(func_name, f));
13 }
14 
15 ma_action*
16 ma_action_factory::create_instance(std::string const& func_name, ma_rule const* rule, pset_t const& pset)
17 {
18  gen_map_t::iterator it = get_map().find(func_name);
19 
20  if (it != get_map().end())
21  return it->second(rule, pset);
22 
23  throw std::runtime_error("unknown action name while creating instance of ma_action");
24 }
base class - all customized fucntions are inherited from it
Definition: ma_action.h:25