29 void checkDicts(BranchDescription
const& productDesc) {
30 if(productDesc.transient()) {
48 anyProductProduced_(
false),
52 eventNextIndexValue_(0),
53 lumiNextIndexValue_(0),
54 runNextIndexValue_(0),
57 missingDictionaries_() {
64 constProductList_.clear();
65 for(
bool& isProduced : productProduced_) isProduced =
false;
66 anyProductProduced_ =
false;
70 eventNextIndexValue_ = 0;
71 lumiNextIndexValue_ = 0;
72 runNextIndexValue_ = 0;
74 branchIDToIndex_.clear();
75 missingDictionaries_.clear();
89 checkDicts(productDesc);
90 std::pair<ProductList::iterator, bool>
ret =
94 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
95 <<
"Please modify the configuration file to use a distinct process name.\n";
108 std::pair<ProductList::iterator, bool>
ret =
123 assert(
combinable(iter->second, productDesc));
124 iter->second.merge(productDesc);
133 if(it->second.branchType() == brType) {
140 boost::shared_ptr<ProductHolderIndexHelper>
const&
151 if(initializeLookupInfo) {
160 <<
"cannot modify the ProductRegistry because it is frozen\n";
168 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
176 std::vector<std::string>
178 std::vector<std::string>
result;
182 result.push_back(product.second.branchName());
187 std::vector<BranchDescription const*>
189 std::vector<BranchDescription const*>
result;
193 result.push_back(&product.second);
200 for(
auto const& product : other) {
216 std::ostringstream differences;
218 ProductRegistry::ProductList::iterator
j =
productList_.begin();
219 ProductRegistry::ProductList::iterator
s =
productList_.end();
220 ProductRegistry::ProductList::const_iterator
i = other.
productList().begin();
221 ProductRegistry::ProductList::const_iterator
e = other.
productList().end();
224 while(j != s || i != e) {
225 if(j != s && j->second.produced()) {
228 }
else if(j == s || (i != e && i->first < j->first)) {
229 if(i->second.present()) {
230 differences <<
"Branch '" << i->second.branchName() <<
"' is in file '" << fileName <<
"'\n";
231 differences <<
" but not in previous files.\n";
238 }
else if(i == e || (j != s && j->first < i->first)) {
240 differences <<
"Branch '" << j->second.branchName() <<
"' is in previous files\n";
241 differences <<
" but not in file '" << fileName <<
"'.\n";
247 j->second.merge(i->second);
256 return differences.str();
262 auto const&
key = product.first;
263 auto const& desc = product.second;
275 auto const&
key = product.first;
276 auto const& desc = product.second;
280 if(desc.produced()) {
288 if(!
bool(type) || !bool(wrappedType)) {
289 missingDicts.insert(desc.className());
293 desc.moduleLabel().c_str(),
294 desc.productInstanceName().c_str(),
295 desc.processName().c_str());
309 for(
auto const& product : productList_) {
310 auto const& desc = product.second;
326 return itFind->second;
331 os << product.second <<
"\n-----\n";
void setProductProduced(BranchType branchType)
static TypeWithDict byName(std::string const &className)
boost::shared_ptr< ProductHolderIndexHelper > lumiProductLookup_
ProductHolderIndex & nextIndexValue(BranchType branchType)
void throwIfNotFrozen() const
std::vector< std::string > allBranchNames() const
std::map< BranchKey, BranchDescription > ProductList
ProductHolderIndex indexFrom(BranchID const &iID) const
bool anyProducts(BranchType const brType) const
std::string const & processName() const
ProductHolderIndex eventNextIndexValue_
void initializeLookupTables()
unsigned int ProductHolderIndex
ProductList::size_type size() const
ProductHolderIndex const & getNextIndexValue(BranchType branchType) const
void addLabelAlias(BranchDescription const &productdesc, std::string const &labelAlias, std::string const &instanceAlias)
virtual void addCalled(BranchDescription const &, bool iFromListener)
boost::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
ProductList const & productList() const
ConstProductList & constProductList()
bool combinable(BranchDescription const &a, BranchDescription const &b)
std::set< std::string > StringSet
void checkDictionaries(std::string const &name, bool noComponents=false)
ProductHolderIndex lumiNextIndexValue_
std::vector< BranchDescription const * > allBranchDescriptions() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
boost::array< bool, NumBranchTypes > productProduced_
BranchID const & branchID() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
void setFrozen(bool initializeLookupInfo=true)
void freezeIt(bool frozen=true)
void print(std::ostream &os) const
ProductHolderIndex runNextIndexValue_
std::vector< std::string > & missingDictionariesForUpdate()
boost::shared_ptr< ProductHolderIndexHelper > runProductLookup_
std::string wrappedClassName(std::string const &iFullName)
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
void throwIfFrozen() const
void updateConstProductRegistry()
void updateFromInput(ProductList const &other)
boost::shared_ptr< ProductHolderIndexHelper > eventProductLookup_
std::map< BranchID, ProductHolderIndex > branchIDToIndex_
volatile std::atomic< bool > shutdown_flag false
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
void copyProduct(BranchDescription const &productdesc)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)