38 anyProductProduced_(
false),
42 eventNextIndexValue_(0),
43 lumiNextIndexValue_(0),
44 runNextIndexValue_(0),
47 missingDictionaries_() {
54 for(
bool& isProduced : productProduced_) isProduced =
false;
55 anyProductProduced_ =
false;
58 eventProductLookup_ = std::make_unique<ProductHolderIndexHelper>();
59 lumiProductLookup_ = std::make_unique<ProductHolderIndexHelper>();
60 runProductLookup_ = std::make_unique<ProductHolderIndexHelper>();
62 eventNextIndexValue_ = 0;
63 lumiNextIndexValue_ = 0;
64 runNextIndexValue_ = 0;
66 branchIDToIndex_.clear();
67 missingDictionaries_.clear();
81 std::pair<ProductList::iterator, bool>
ret =
85 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
86 <<
"Please modify the configuration file to use a distinct process name.\n";
99 std::pair<ProductList::iterator, bool>
ret =
117 iter->second.merge(productDesc);
126 if(it->second.branchType() == brType) {
133 std::shared_ptr<ProductHolderIndexHelper const>
140 std::shared_ptr<ProductHolderIndexHelper>
151 if(initializeLookupInfo) {
161 <<
"cannot modify the ProductRegistry because it is frozen\n";
169 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
177 std::vector<std::string>
179 std::vector<std::string>
result;
183 result.push_back(product.second.branchName());
188 std::vector<BranchDescription const*>
190 std::vector<BranchDescription const*>
result;
194 result.push_back(&product.second);
201 for(
auto const& product : other) {
217 std::ostringstream differences;
219 ProductRegistry::ProductList::iterator
j =
productList_.begin();
220 ProductRegistry::ProductList::iterator
s =
productList_.end();
221 ProductRegistry::ProductList::const_iterator
i = other.
productList().begin();
222 ProductRegistry::ProductList::const_iterator
e = other.
productList().end();
225 while(j != s || i != e) {
226 if(j != s && j->second.produced()) {
229 }
else if(j == s || (i != e && i->first < j->first)) {
230 if(i->second.present()) {
231 differences <<
"Branch '" << i->second.branchName() <<
"' is in file '" << fileName <<
"'\n";
232 differences <<
" but not in previous files.\n";
239 }
else if(i == e || (j != s && j->first < i->first)) {
241 differences <<
"Branch '" << j->second.branchName() <<
"' is in previous files\n";
242 differences <<
" but not in file '" << fileName <<
"'.\n";
248 j->second.merge(i->second);
256 return differences.str();
261 std::map<TypeID, TypeID> containedTypeMap;
267 auto const& desc = product.second;
269 if(desc.produced()) {
275 if(!
bool(desc.unwrappedType())) {
276 missingDicts.insert(
TypeID(desc.unwrappedType().typeInfo()));
277 }
else if(!
bool(desc.wrappedType())) {
278 missingDicts.insert(
TypeID(desc.wrappedType().typeInfo()));
280 TypeID wrappedTypeID(desc.wrappedType().typeInfo());
281 TypeID typeID(desc.unwrappedType().typeInfo());
283 auto const& iter = containedTypeMap.find(typeID);
284 if(iter != containedTypeMap.end()) {
285 containedTypeID = iter->second;
288 containedTypeMap.emplace(typeID, containedTypeID);
292 desc.moduleLabel().c_str(),
293 desc.productInstanceName().c_str(),
294 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";
tuple ret
prodAgent to be discontinued
void setProductProduced(BranchType branchType)
ProductHolderIndex & nextIndexValue(BranchType branchType)
std::vector< TypeID > & missingDictionariesForUpdate()
void throwIfNotFrozen() const
TypeID getContainedTypeFromWrapper(TypeID const &wrappedtypeID, std::string const &className)
std::shared_ptr< ProductHolderIndexHelper const > runProductLookup() 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_
std::shared_ptr< ProductHolderIndexHelper const > productLookup(BranchType branchType) const
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)
ProductList const & productList() const
std::shared_ptr< ProductHolderIndexHelper const > lumiProductLookup() const
std::string const & moduleLabel() const
std::set< TypeID > TypeSet
bool combinable(BranchDescription const &a, BranchDescription const &b)
ProductHolderIndex lumiNextIndexValue_
std::shared_ptr< ProductHolderIndexHelper const > eventProductLookup() const
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_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
std::vector< std::pair< std::string, std::string > > aliasToOriginal_
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
void throwIfFrozen() const
void updateFromInput(ProductList const &other)
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)