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