Functions
art::InputSourceFactory Namespace Reference

Functions

unique_ptr< InputSourcemake (ParameterSet const &conf, InputSourceDescription &desc)
 

Function Documentation

std::unique_ptr< InputSource > art::InputSourceFactory::make ( ParameterSet const &  conf,
InputSourceDescription desc 
)

Definition at line 23 of file InputSourceFactory.cc.

24  {
25  auto const& libspec = conf.get<string>("module_type");
26  FDEBUG(1) << "InputSourceFactory: module_type = " << libspec << endl;
27  using make_t =
28  unique_ptr<InputSource>(ParameterSet const&, InputSourceDescription&);
29  make_t* symbol = nullptr;
30  try {
31  cet::LibraryManager lm_{Suffixes::source()};
32  lm_.getSymbolByLibspec(libspec, "make", symbol);
33  }
34  catch (Exception const& e) {
36  e, "InputSource", libspec, getReleaseVersion());
37  }
38  if (symbol == nullptr) {
39  throw Exception(errors::Configuration, "BadPluginLibrary")
40  << "InputSource " << libspec
41  << " has internal symbol definition problems: consult an expert.";
42  }
43  auto wm = symbol(conf, desc);
44  FDEBUG(1) << "InputSourceFactory: created input source " << libspec
45  << endl;
46  return wm;
47  }
Definition: conf.py:1
T getSymbolByLibspec(std::string const &libspec, std::string const &sym_name) const
const double e
std::string const & getReleaseVersion()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
#define FDEBUG(LEVEL)
Definition: DebugMacros.h:25
void wrapLibraryManagerException(cet::exception const &e, std::string const &item_type, std::string const &libspec, std::string const &release)
QTextStream & endl(QTextStream &s)