LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::InputSourceFactory Class Reference

#include "InputSourceFactory.h"

Static Public Member Functions

static std::unique_ptr< InputSourcemake (fhicl::ParameterSet const &, InputSourceDescription &)
 

Private Member Functions

 InputSourceFactory (InputSourceFactory const &)=delete
 
InputSourceFactoryoperator= (InputSourceFactory const &)=delete
 
 InputSourceFactory ()=default
 

Static Private Member Functions

static InputSourceFactoryinstance ()
 

Private Attributes

cet::LibraryManager lm_ {Suffixes::source()}
 

Detailed Description

Definition at line 23 of file InputSourceFactory.h.

Constructor & Destructor Documentation

art::InputSourceFactory::InputSourceFactory ( InputSourceFactory const &  )
privatedelete
art::InputSourceFactory::InputSourceFactory ( )
explicitprivatedefault

Member Function Documentation

InputSourceFactory & InputSourceFactory::instance ( )
staticprivate

Definition at line 15 of file InputSourceFactory.cc.

Referenced by make().

16 {
17  static InputSourceFactory the_factory;
18  return the_factory;
19 }
std::unique_ptr< InputSource > InputSourceFactory::make ( fhicl::ParameterSet const &  conf,
InputSourceDescription desc 
)
static

Definition at line 22 of file InputSourceFactory.cc.

References art::errors::Configuration, e, FDEBUG, fhicl::ParameterSet::get(), art::getReleaseVersion(), instance(), and lm_.

23 {
24  auto const& libspec = conf.get<std::string>("module_type");
25 
26  FDEBUG(1) << "InputSourceFactory: module_type = " << libspec << std::endl;
27 
28  using make_t = std::unique_ptr<InputSource>(fhicl::ParameterSet const&,
30 
31  make_t* symbol = nullptr;
32 
33  try {
34  instance().lm_.getSymbolByLibspec(libspec, "make", symbol);
35  }
36  catch (art::Exception const& e) {
37  cet::detail::wrapLibraryManagerException(
38  e, "InputSource", libspec, getReleaseVersion());
39  }
40  if (symbol == nullptr) {
41  throw art::Exception(errors::Configuration, "BadPluginLibrary")
42  << "InputSource " << libspec
43  << " has internal symbol definition problems: consult an expert.";
44  }
45  auto wm = symbol(conf, desc);
46  FDEBUG(1) << "InputSourceFactory: created input source " << libspec
47  << std::endl;
48  return wm;
49 }
static InputSourceFactory & instance()
cet::LibraryManager lm_
std::string const & getReleaseVersion()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
#define FDEBUG(lev)
Definition: DebugMacros.h:26
Float_t e
Definition: plot.C:34
InputSourceFactory& art::InputSourceFactory::operator= ( InputSourceFactory const &  )
privatedelete

Member Data Documentation

cet::LibraryManager art::InputSourceFactory::lm_ {Suffixes::source()}
private

Definition at line 35 of file InputSourceFactory.h.

Referenced by make().


The documentation for this class was generated from the following files: