ProducerBase.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_ProducerBase_h
2 #define art_Framework_Core_ProducerBase_h
3 
4 //----------------------------------------------------------------------
5 // ProducerBase: The base class of all "modules" that will insert new
6 // EDProducts into an Event.
7 //----------------------------------------------------------------------
8 
17 #include "fhiclcpp/types/Atom.h"
20 #include "fhiclcpp/types/Table.h"
22 
23 #include <functional>
24 #include <memory>
25 #include <sstream>
26 #include <string>
27 
28 namespace art {
29 
30  class BranchDescription;
31  class ModuleDescription;
32 
34  public:
38 
39  bool
40  modifiesEvent() const
41  {
42  return true;
43  }
44 
45  template <typename PROD, BranchType B>
46  ProductID getProductID(ModuleDescription const& moduleDescription,
47  std::string const& instanceName) const;
48 
49  template <typename UserConfig, typename UserKeysToIgnore = void>
50  using Table =
52  };
53 
54  template <typename PROD, BranchType B>
55  ProductID
57  std::string const& instanceName) const
58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
63 
64  template <typename T>
65  inline std::ostream&
66  operator<<(std::ostream& os, ProducerBase::Table<T> const& t)
67  {
68  std::ostringstream config;
69  t.print_allowed_configuration(config, std::string(3, ' '));
70  return os << config.str();
71  }
72 
73 } // art
74 
75 #endif /* art_Framework_Core_ProducerBase_h */
76 
77 // Local Variables:
78 // mode: c++
79 // End:
void registerProducts(MasterProductRegistry &mpr, ProductDescriptions &productsToRegister, ModuleDescription const &md)
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
ProductID getProductID(ModuleDescription const &moduleDescription, std::string const &instanceName) const
Definition: ProducerBase.h:56
std::string const & moduleLabel() const
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
bool modifiesEvent() const
Definition: ProducerBase.h:40
std::set< TypeLabel > const & expectedProducts() const
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8