artdaq_mfextensions  v1_05_00
ma_function.cpp
1 
2 #include "ErrorHandler/MessageAnalyzer/ma_function.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_function_factory::reg( std::string const & func_name, gen_func_t f )
15 {
16  get_map().insert( std::make_pair(func_name, f) );
17 }
18 
20  ma_function_factory::create_instance( std::string const & func_name )
21 {
22  gen_map_t::iterator it = get_map().find(func_name);
23 
24  if( it!=get_map().end() )
25  return it->second();
26 
27  throw std::runtime_error("unknown function name while creating instance of ma_function" );
28 }