1 #ifndef art_Utilities_detail_tool_type_h 2 #define art_Utilities_detail_tool_type_h 5 #include "cetlib/BasicPluginFactory.h" 10 #include <type_traits> 18 template <
typename T,
typename =
void>
27 std::string
const& libspec,
30 return factory.makePlugin<std::unique_ptr<T>>(libspec, pset);
35 struct tool_type<T,
std::enable_if_t<std::is_function<T>::value>> {
40 std::string
const& libspec,
42 std::string
const& function_plugin_type)
44 auto const pluginType = factory.pluginType(libspec);
45 return pluginType == function_plugin_type ?
46 factory.makePlugin<T>(libspec) :
48 "tool_type::make_plugin: ")
49 <<
"Unrecognized function-tool type \"" << function_plugin_type
50 <<
"\" for plugin \"" << libspec <<
"\".\n" 51 <<
"Allowed function-tool type for above plugin is: \"" 52 << pluginType <<
"\".\n";
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception