1 #ifndef cetlib_BasicPluginFactory_h 2 #define cetlib_BasicPluginFactory_h 23 #include <type_traits> 26 class BasicPluginFactory;
36 std::string const& pluginTypeFuncName =
"pluginType");
41 std::string const& pluginTypeFuncName =
"pluginType");
44 template <
typename RESULT_TYPE,
typename... ARGS>
45 std::enable_if_t<!std::is_function_v<RESULT_TYPE>, RESULT_TYPE>
makePlugin(
47 ARGS&&...
args)
const;
49 template <
typename FUNCTION_TYPE>
50 std::enable_if_t<std::is_function_v<FUNCTION_TYPE>,
51 std::function<FUNCTION_TYPE>>
68 template <
typename RESULT_TYPE,
typename... ARGS>
69 inline std::enable_if_t<!std::is_function_v<RESULT_TYPE>, RESULT_TYPE>
73 return call<RESULT_TYPE>(libspec,
makerName_, std::forward<ARGS>(
args)...);
76 template <
typename FUNCTION_TYPE>
77 inline std::enable_if_t<std::is_function_v<FUNCTION_TYPE>,
78 std::function<FUNCTION_TYPE>>
81 return find<FUNCTION_TYPE>(libspec,
makerName_);
std::string const pluginTypeFuncName_
std::enable_if_t<!std::is_function_v< RESULT_TYPE >, RESULT_TYPE > makePlugin(std::string const &libspec, ARGS &&...args) const
std::string const makerName_
BasicPluginFactory(cet::search_path const &search_path, std::string const &suffix="plugin", std::string const &makerName="makePlugin", std::string const &pluginTypeFuncName="pluginType")
std::string pluginType(std::string const &libspec) const