1 #ifndef art_Framework_Core_ProductRegistryHelper_h 2 #define art_Framework_Core_ProductRegistryHelper_h 28 #include "cetlib_except/demangle.h" 29 #include "cetlib_except/exception.h" 36 class ModuleDescription;
54 productList_ = std::move(p);
66 template <
typename P, BranchType B>
68 std::string
const& instanceName = {});
70 template <BranchType B>
75 template <
typename P, BranchType B = InEvent>
76 void produces(std::string
const& instanceName = {},
86 std::unique_ptr<ProductList const> productList_{
nullptr};
91 template <BranchType B>
95 return collector_.expectedProducts(B);
98 template <
typename P, art::BranchType B>
105 "An error occurred while registering a product.\n"}
106 <<
"The following product was registered with 'produces' when\n" 107 "'reconstitutes' should have been called instead.\n" 108 <<
" Branch type: " << B <<
'\n' 109 <<
" Class name: " << cet::demangle_symbol(
typeid(P).name()) <<
'\n' 110 <<
" Instance name: '" << instanceName <<
"'\n";
112 collector_.produces<P, B>(instanceName, persistable);
115 template <
typename P, BranchType B>
118 std::string
const& instanceName)
122 "An error occurred while registering a product.\n"}
123 <<
"The following product was registered with 'reconstitutes' when\n" 124 "'produces' should have been called instead.\n" 125 <<
" Branch type: " << B <<
'\n' 126 <<
" Class name: " << cet::demangle_symbol(
typeid(P).name()) <<
'\n' 127 <<
" Emulated module name: '" << emulatedModule <<
"'\n" 128 <<
" Instance name: '" << instanceName <<
"'\n";
130 return collector_.reconstitutes<P, B>(emulatedModule, instanceName);
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
std::vector< BranchDescription > ProductDescriptions
void productList(std::unique_ptr< ProductList > p)
product_creation_mode mode_
std::map< TypeLabel, BranchDescription > TypeLabelLookup_t
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
ProducesCollector & producesCollector() noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
TypeLabelLookup_t const & expectedProducts() const
ProducesCollector collector_