1 #ifndef art_Utilities_make_tool_h 2 #define art_Utilities_make_tool_h 7 #include "cetlib/BasicPluginFactory.h" 8 #include "cetlib/detail/wrapLibraryManagerException.h" 21 std::string
const libspec{pset.
get<std::string>(
"tool_type")};
28 <<
"Exception caught while processing plugin spec: " << libspec <<
'\n';
36 std::string
const& function_tool_type)
38 cet::BasicPluginFactory factory{
40 std::string
const libspec{pset.
get<std::string>(
"tool_type")};
44 factory, libspec, pset, function_tool_type);
48 <<
"Exception caught while processing plugin spec: " << libspec <<
'\n';
53 template <
typename T,
typename TableConfig>
55 make_tool(TableConfig
const& tc, std::string
const& function_tool_type)
57 if constexpr (std::is_class_v<T>) {
58 return make_tool<T>(tc.get_PSet());
59 }
else if (std::is_function_v<T>) {
60 return make_tool<T>(tc.get_PSet(), function_tool_type);
std::enable_if_t< std::is_class< T >::value, tool_return_type< T > > make_tool(fhicl::ParameterSet const &pset)
T get(std::string const &key) const
static std::string const & tool()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
typename detail::tool_type< T >::return_type tool_return_type
cet::coded_exception< error, detail::translate > exception