LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ModuleBase.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
6 
7 namespace art {
8 
9  ModuleBase::~ModuleBase() noexcept = default;
10  ModuleBase::ModuleBase() = default;
11 
12  ModuleDescription const&
13  ModuleBase::moduleDescription() const
14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
29 
30  void
32  {
33  md_ = md;
34  }
35 
36  std::unique_ptr<Worker>
38  {
39  return doMakeWorker(wp);
40  }
41 
42  std::array<std::vector<ProductInfo>, NumBranchTypes> const&
44  {
45  return collector_.getConsumables();
46  }
47 
48  void
49  ModuleBase::sortConsumables(std::string const& current_process_name)
50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
55 
58  {
59  return collector_;
60  }
61 
62 } // namespace art
ConsumesCollector collector_
Definition: ModuleBase.h:56
ConsumesCollector & consumesCollector()
Definition: ModuleBase.cc:57
void sortConsumables(std::string const &current_process_name)
Definition: ModuleBase.cc:49
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
void setModuleDescription(ModuleDescription const &)
Definition: ModuleBase.cc:31
virtual ~ModuleBase() noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Definition: ModuleBase.cc:43
std::unique_ptr< Worker > makeWorker(WorkerParams const &wp)
Definition: ModuleBase.cc:37
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void sortConsumables(std::string const &current_process_name)
Definition: MVAAlg.h:12