1 #ifndef art_Framework_Principal_ProductInserter_h 2 #define art_Framework_Principal_ProductInserter_h 21 #include "cetlib/HorizontalRule.h" 22 #include "cetlib/exempt_ptr.h" 23 #include "cetlib_except/exception.h" 50 template <
typename PROD>
55 template <
typename PROD>
63 std::map<TypeLabel, BranchDescription>
const* expectedProducts,
64 std::vector<ProductID> retrievedPIDs);
75 std::string
const& instance,
76 bool const alwaysEnableLookupOfProducedProducts =
false)
const;
82 mutable std::unique_ptr<std::recursive_mutex>
mutex_{
83 std::make_unique<std::recursive_mutex>()};
100 template <
typename PROD>
107 template <
typename PROD>
113 TypeID const tid{
typeid(PROD)};
116 <<
"A null unique_ptr was passed to 'put'.\n" 117 <<
"The pointer is of type " << tid <<
".\n" 118 <<
"The specified productInstanceName was '" << instance <<
"'.\n";
121 std::lock_guard lock{*
mutex_};
124 auto const typeLabel =
126 auto wp = std::make_unique<Wrapper<PROD>>(std::move(edp));
130 cet::exempt_ptr<PROD const>
product{wp->product()};
135 constexpr cet::HorizontalRule rule{30};
137 <<
"Attempt to put multiple products with the following descriptions.\n" 138 <<
"Each product must be unique.\n" 140 << bd << rule(
'=') <<
'\n';
ProductInserter(BranchType bt, Principal &p, ModuleContext const &mc)
EDProductGetter const * productGetter_(ProductID id) const
BranchDescription const & description
TypeLabel type_label_for(TypeID const typeID, std::string const &instance, bool const supportsView, ModuleDescription const &md)
const std::string instance
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
ProductInserter & operator=(ProductInserter const &)=delete
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
BranchDescription const & getProductDescription_(TypeID const &type, std::string const &instance, bool const alwaysEnableLookupOfProducedProducts=false) const
std::unique_ptr< EDProduct > product
std::map< TypeLabel, PMValue > putProducts_
std::unique_ptr< std::recursive_mutex > mutex_
static constexpr ProductID invalid() noexcept
static RangeSet invalid()
second_as<> second
Type of time stored in seconds, in double precision.
Provenance provenance_(ProductID id) const
ModuleDescription const * md_