Public Member Functions | Protected Member Functions | Private Attributes | List of all members
art::ModuleBase Class Reference

#include <ModuleBase.h>

Inheritance diagram for art::ModuleBase:
art::Modifier art::Observer art::ResultsProducer art::detail::Filter art::detail::Producer art::detail::Analyzer art::OutputModule art::test::DummyResultsProducer art::EDFilter art::ReplicatedFilter art::SharedFilter art::EDProducer art::ReplicatedProducer art::SharedProducer art::EDAnalyzer art::ReplicatedAnalyzer art::SharedAnalyzer art::FileDumperOutput art::ProvenanceCheckerOutput art::ProvenanceDumper< DETAIL, Enable > art::ProvenanceDumper< DETAIL, std::void_t< typename DETAIL::Config > > art::test::PMTestOutput arttest::EventProcessorTestOutput

Public Member Functions

virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

std::optional< ModuleDescriptionmd_ {std::nullopt}
 
ConsumesCollector collector_
 

Detailed Description

Definition at line 17 of file ModuleBase.h.

Constructor & Destructor Documentation

art::ModuleBase::~ModuleBase ( )
virtualdefaultnoexcept
art::ModuleBase::ModuleBase ( )
default

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protected

Definition at line 54 of file ModuleBase.h.

55  {
56  return collector_.consumes<T, BT>(tag);
57  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protected

Definition at line 53 of file ModuleBase.cc.

54  {
55  return collector_;
56  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protected

Definition at line 68 of file ModuleBase.h.

template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protected
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)

Definition at line 61 of file ModuleBase.h.

62  {
63  return collector_.consumesView<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
ViewToken< Element > consumesView(InputTag const &)
array< vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const

Definition at line 39 of file ModuleBase.cc.

40  {
41  return collector_.getConsumables();
42  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protected

Definition at line 75 of file ModuleBase.h.

76  {
77  return collector_.mayConsume<T, BT>(tag);
78  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:49
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protected

Definition at line 89 of file ModuleBase.h.

template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protected
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)

Definition at line 82 of file ModuleBase.h.

83  {
84  return collector_.mayConsumeView<T, BT>(tag);
85  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const

Definition at line 15 of file ModuleBase.cc.

16  {
17  if (md_.has_value()) {
18  return *md_;
19  }
20 
22  "There was an error while calling moduleDescription().\n"}
23  << "The moduleDescription() base-class member function cannot be called\n"
24  "during module construction. To determine which module is "
25  "responsible\n"
26  "for calling it, find the '<module type>:<module "
27  "label>@Construction'\n"
28  "tag in the message prefix above. Please contact artists@fnal.gov\n"
29  "for guidance.\n";
30  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:48
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)

Definition at line 33 of file ModuleBase.cc.

34  {
35  md_ = md;
36  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:48
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)

Definition at line 45 of file ModuleBase.cc.

46  {
47  // Now that we know we have seen all the consumes declarations,
48  // sort the results for fast lookup later.
49  collector_.sortConsumables(current_process_name);
50  }
ConsumesCollector collector_
Definition: ModuleBase.h:49
void sortConsumables(std::string const &current_process_name)

Member Data Documentation

ConsumesCollector art::ModuleBase::collector_
private

Definition at line 49 of file ModuleBase.h.

std::optional<ModuleDescription> art::ModuleBase::md_ {std::nullopt}
private

Definition at line 48 of file ModuleBase.h.


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