1 #ifndef art_Framework_IO_Sources_put_product_in_principal_h 2 #define art_Framework_IO_Sources_put_product_in_principal_h 42 template <
typename T,
typename P>
43 std::enable_if_t<!detail::range_sets_supported(P::branch_type)>
46 std::string
const& module_label,
47 std::string
const& instance_name = {})
49 TypeID const typeID{
typeid(T)};
50 if (product.get() ==
nullptr) {
52 <<
"put_product_in_principal: A null unique_ptr was passed to 'put'.\n" 53 <<
"The pointer is of type " << typeID <<
".\n" 54 <<
"The specified product instance name was '" << instance_name
58 auto const& process_name = principal.processConfiguration().processName();
60 typeID.friendlyClassName(), module_label, instance_name, process_name);
62 auto desc = principal.getProductDescription(
pid);
65 "put_product_in_principal: error while trying to " 66 "retrieve product description:\n")
67 <<
"No product is registered for\n" 68 <<
" process name: '" << process_name <<
"'\n" 69 <<
" module label: '" << module_label <<
"'\n" 70 <<
" product friendly class name: '" << typeID.friendlyClassName()
72 <<
" product instance name: '" << instance_name <<
"'\n" 73 <<
" branch type: '" << principal.branchType()
80 std::make_unique<
Wrapper<T>>(std::move(product)),
84 template <
typename T,
typename P>
85 std::enable_if_t<detail::range_sets_supported(P::branch_type)>
88 std::string
const& module_label,
89 std::string
const& instance_name = {},
92 TypeID const typeID{
typeid(T)};
93 if (product.get() ==
nullptr) {
95 <<
"put_product_in_principal: A null unique_ptr was passed to 'put'.\n" 96 <<
"The pointer is of type " << typeID <<
".\n" 97 <<
"The specified product instance name was '" << instance_name
101 auto const& process_name = principal.processConfiguration().processName();
103 typeID.friendlyClassName(), module_label, instance_name, process_name);
105 auto desc = principal.getProductDescription(
pid);
108 "put_product_in_principal: error while trying to " 109 "retrieve product description:\n")
110 <<
"No product is registered for\n" 111 <<
" process name: '" << process_name <<
"'\n" 112 <<
" module label: '" << module_label <<
"'\n" 113 <<
" product friendly class name: '" << typeID.friendlyClassName()
115 <<
" product instance name: '" << instance_name <<
"'\n" 116 <<
" branch type: '" << principal.branchType()
129 std::make_unique<
Wrapper<T>>(std::move(product)),
130 std::make_unique<RangeSet>(rs));
RangeSet rangeSetFor(RunPrincipal const &rp)
static RangeSet forSubRun(SubRunID)
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::enable_if_t<!detail::range_sets_supported(P::branch_type)> put_product_in_principal(std::unique_ptr< T > &&product, P &principal, std::string const &module_label, std::string const &instance_name={})
static RangeSet invalid()
static RangeSet forRun(RunID)
SubRunID subRunID() const
constexpr ProductStatus present() noexcept