LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::detail::ModuleFactory Class Reference

#include "ModuleFactory.h"

Public Member Functions

 ModuleFactory ()=default
 
 ModuleFactory (ModuleFactory const &)=delete
 
ModuleFactoryoperator= (ModuleFactory const &)=delete
 
ModuleType moduleType (std::string const &libspec)
 
std::unique_ptr< WorkermakeWorker (WorkerParams const &wp, ModuleDescription const &md)
 

Private Attributes

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

Detailed Description

Definition at line 26 of file ModuleFactory.h.

Constructor & Destructor Documentation

art::detail::ModuleFactory::ModuleFactory ( )
default
art::detail::ModuleFactory::ModuleFactory ( ModuleFactory const &  )
delete

Member Function Documentation

std::unique_ptr< art::Worker > art::detail::ModuleFactory::makeWorker ( WorkerParams const &  wp,
ModuleDescription const &  md 
)

Definition at line 29 of file ModuleFactory.cc.

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

Referenced by art::PathsInfo::makeWorker_().

31 {
32  auto const& libspec = p.pset_.get<std::string>("module_type");
33  WorkerMaker_t* symbol = nullptr;
34  try {
35  lm_.getSymbolByLibspec(libspec, "make_worker", symbol);
36  }
37  catch (art::Exception& e) {
38  cet::detail::wrapLibraryManagerException(
39  e, "Module", libspec, getReleaseVersion());
40  }
41  if (symbol == nullptr) {
42  throw art::Exception(errors::Configuration, "BadPluginLibrary: ")
43  << "Module " << libspec << " with version " << getReleaseVersion()
44  << " has internal symbol definition problems: consult an expert.";
45  }
46  return std::unique_ptr<Worker>(symbol(p, md));
47 } // makeWorker()
Worker *(WorkerParams const &, ModuleDescription const &) WorkerMaker_t
Definition: ModuleMacros.h:36
std::string const & getReleaseVersion()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:34
cet::LibraryManager lm_
Definition: ModuleFactory.h:39
art::ModuleType art::detail::ModuleFactory::moduleType ( std::string const &  libspec)

Definition at line 10 of file ModuleFactory.cc.

References art::errors::Configuration, e, art::getReleaseVersion(), and lm_.

Referenced by art::PathManager::fillAllModules_().

11 {
12  ModuleTypeFunc_t* symbol = nullptr;
13  try {
14  lm_.getSymbolByLibspec(libspec, "moduleType", symbol);
15  }
16  catch (art::Exception& e) {
17  cet::detail::wrapLibraryManagerException(
18  e, "Module", libspec, getReleaseVersion());
19  }
20  if (symbol == nullptr) {
21  throw art::Exception(errors::Configuration, "BadPluginLibrary")
22  << "Module " << libspec << " with version " << getReleaseVersion()
23  << " has internal symbol definition problems: consult an expert.";
24  }
25  return symbol();
26 }
std::string const & getReleaseVersion()
ModuleType( ModuleTypeFunc_t)
Definition: ModuleMacros.h:37
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:34
cet::LibraryManager lm_
Definition: ModuleFactory.h:39
ModuleFactory& art::detail::ModuleFactory::operator= ( ModuleFactory const &  )
delete

Member Data Documentation

cet::LibraryManager art::detail::ModuleFactory::lm_ {Suffixes::module()}
private

Definition at line 39 of file ModuleFactory.h.

Referenced by makeWorker(), and moduleType().


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