5 #include "cetlib/assert_only_one_thread.h" 6 #include "cetlib_except/exception.h" 16 CET_ASSERT_ONLY_ONE_THREAD();
19 allowExplicitRegistration_ =
false;
20 cet::for_all(productListUpdatedCallbacks_,
21 [
this](
auto const& callback) { callback(productList_); });
28 CET_ASSERT_ONLY_ONE_THREAD();
29 for (
auto&& desc : descriptions) {
30 addProduct_(std::move(desc));
37 CET_ASSERT_ONLY_ONE_THREAD();
40 updateProductLists_(*pl);
46 CET_ASSERT_ONLY_ONE_THREAD();
47 updateProductLists_(pl);
48 cet::for_all(productListUpdatedCallbacks_,
49 [
this](
auto const& callback) { callback(productList_); });
56 CET_ASSERT_ONLY_ONE_THREAD();
57 productListUpdatedCallbacks_.push_back(cb);
64 for (
auto const& val : productList_) {
65 os << val.second <<
"\n-----\n";
75 CET_ASSERT_ONLY_ONE_THREAD();
80 if (!allowExplicitRegistration_) {
82 <<
"An attempt to register the product\n" 83 << bdp <<
"was made after the product registry was frozen.\n" 84 <<
"Product registration can be done only in module constructors.\n";
87 assert(bdp.produced());
92 <<
"The process name " << bdp.processName()
93 <<
" was previously used on these products.\n" 94 <<
"Please modify the configuration file to use a " 95 <<
"distinct process name.\n";
97 auto& productListEntry = *it.first;
98 auto& pd = productListEntry.second;
100 productProduced_[pd.branchType()] =
true;
106 for (
auto const& val : pl) {
107 auto const& pd = val.second;
108 assert(!pd.produced());
110 auto it = productList_.find(bk);
111 if (it == productList_.end()) {
113 productList_.emplace(bk, pd);
116 auto& found_pd = it->second;
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
void print(std::ostream &) const
std::map< BranchKey, BranchDescription > ProductList
void updateFromModule(std::unique_ptr< ProductList > &&)
std::vector< BranchDescription > ProductDescriptions
void registerProductListUpdatedCallback(ProductListUpdatedCallback cb)
void updateProductLists_(ProductList const &pl)
void updateFromInputFile(ProductList const &)
std::function< void(ProductList const &)> ProductListUpdatedCallback
void finalizeForProcessing()
bool combinable(BranchDescription const &a, BranchDescription const &b)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
void addProduct_(BranchDescription &&)
void addProductsFromModule(ProductDescriptions &&)