LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
PluginSymbolResolvers.cc
Go to the documentation of this file.
2 
3 using namespace std::string_literals;
4 namespace bfs = boost::filesystem;
5 using cet::LibraryManager;
6 
7 namespace art {
8  namespace detail {
9 
10  template <>
11  std::string
12  getType<suffix_type::module>(cet::LibraryManager const& lm,
13  std::string const& fullSpec)
14  {
16 
17  auto type = [&lm, &fullSpec] {
18  ModuleTypeFunc_t* symbolType{nullptr};
19  lm.getSymbolByLibspec(fullSpec, "moduleType", symbolType);
20  return art::to_string(symbolType());
21  };
22 
23  return resolve_if_present(type, __func__, "[ error ]"s);
24  }
25 
26  template <>
27  std::string
28  getType<suffix_type::plugin>(cet::LibraryManager const& lm,
29  std::string const& fullSpec)
30  {
31  using PluginTypeFunc_t = std::string();
32 
33  auto type = [&lm, &fullSpec] {
34  PluginTypeFunc_t* symbolType{nullptr};
35  lm.getSymbolByLibspec(fullSpec, "pluginType", symbolType);
36  return symbolType();
37  };
38 
39  return resolve_if_present(type, __func__, "[ error ]"s);
40  }
41 
42  template <>
43  std::string
44  getType<suffix_type::tool>(cet::LibraryManager const& lm,
45  std::string const& fullSpec)
46  {
47  using ToolTypeFunc_t = std::string();
48 
49  auto type = [&lm, &fullSpec] {
50  ToolTypeFunc_t* symbolType{nullptr};
51  lm.getSymbolByLibspec(fullSpec, "toolType", symbolType);
52  return symbolType();
53  };
54 
55  return resolve_if_present(type, __func__, "[ error ]"s);
56  }
57  }
58 }
Float_t s
Definition: plot.C:23
ModuleType( ModuleTypeFunc_t)
Definition: ModuleMacros.h:37
RT resolve_if_present(F f, std::string const &caller, RT result)
HLT enums.
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
ModuleType
Definition: ModuleType.h:22