1 #ifndef art_Framework_Art_detail_PluginSymbolResolvers_h 2 #define art_Framework_Art_detail_PluginSymbolResolvers_h 7 #include "boost/filesystem.hpp" 8 #include "cetlib/LibraryManager.h" 18 template <
typename F,
typename RT = decltype(std::declval<F>()())>
26 std::cout <<
"In: " << caller << std::endl;
27 std::cout << e.what() << std::endl;
32 template <art::suffix_type st>
34 getFilePath(cet::LibraryManager
const& lm, std::string
const& fullspec)
36 using GetSourceLoc_t = std::string();
39 auto path = [&lm, &fullspec] {
40 GetSourceLoc_t* symbolLoc{};
41 lm.getSymbolByLibspec(fullspec,
"get_source_location", symbolLoc);
42 std::string
source{symbolLoc()};
43 boost::filesystem::path
const p{
source};
44 if (!boost::filesystem::exists(p)) {
45 source =
"/ [ external source ] /" + fullspec +
"_" +
54 template <art::suffix_type>
56 getType(cet::LibraryManager
const&, std::string
const& )
62 std::string getType<suffix_type::module>(cet::LibraryManager
const& lm,
63 std::string
const& fullSpec);
65 std::string getType<suffix_type::plugin>(cet::LibraryManager
const& lm,
66 std::string
const& fullSpec);
68 std::string getType<suffix_type::tool>(cet::LibraryManager
const& lm,
69 std::string
const& fullSpec);
71 template <art::suffix_type>
72 std::unique_ptr<fhicl::ConfigurationTable>
74 std::string
const& fullSpec,
75 std::string
const& name)
77 using GetAllowedConfiguration_t =
78 std::unique_ptr<fhicl::ConfigurationTable>(std::string
const&);
80 auto description = [&lm, &fullSpec, &name] {
81 GetAllowedConfiguration_t* symbolType{};
82 lm.getSymbolByLibspec(fullSpec,
"allowed_configuration", symbolType);
83 return symbolType(name);
89 std::unique_ptr<fhicl::ConfigurationTable>{
nullptr});
std::string getType(cet::LibraryManager const &, std::string const &)
std::unique_ptr< fhicl::ConfigurationTable > getAllowedConfiguration(cet::LibraryManager const &lm, std::string const &fullSpec, std::string const &name)
std::string getFilePath(cet::LibraryManager const &lm, std::string const &fullspec)
RT resolve_if_present(F f, std::string const &caller, RT result)
static std::string const & get(suffix_type st)
cet::coded_exception< error, detail::translate > exception