4 #include "boost/filesystem.hpp" 10 namespace bfs = boost::filesystem;
14 template <
typename F,
typename RT = decltype(std::declval<F>()())>
22 std::cerr <<
"In: " << caller <<
'\n' << e.what() <<
'\n';
36 auto path = [&lm, &fullspec] {
37 GetSourceLoc_t* symbolLoc{};
40 boost::filesystem::path
const p{
source};
43 "/ [ external source ] /" + fullspec +
"_" + lm.
libType() +
".cc";
48 return resolve_if_present(path, __func__,
"[ not found ]"s);
54 auto const& suffix = lm.
libType();
55 if (suffix == Suffixes::module()) {
58 auto type = [&lm, &fullSpec] {
64 return resolve_if_present(
type, __func__,
"[ error ]"s);
67 if (suffix == Suffixes::plugin()) {
70 auto type = [&lm, &fullSpec] {
71 PluginTypeFunc_t* symbolType{
nullptr};
76 return resolve_if_present(
type, __func__,
"[ error ]"s);
79 if (suffix == Suffixes::tool()) {
82 auto type = [&lm, &fullSpec] {
83 ToolTypeFunc_t* symbolType{
nullptr};
88 return resolve_if_present(
type, __func__,
"[ error ]"s);
93 std::unique_ptr<fhicl::ConfigurationTable>
98 using GetAllowedConfiguration_t =
99 std::unique_ptr<fhicl::ConfigurationTable>(
std::string const&);
102 GetAllowedConfiguration_t* symbolType{};
104 return symbolType(name);
107 return resolve_if_present(
110 std::unique_ptr<fhicl::ConfigurationTable>{
nullptr});
std::string getType(cet::LibraryManager const &lm, std::string const &fullSpec)
bool exists(std::string path)
T getSymbolByLibspec(std::string const &libspec, std::string const &sym_name) 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)
ModuleType( ModuleTypeFunc_t)
std::string libType() const
std::string to_string(ModuleType const mt)
cet::coded_exception< error, detail::translate > exception