24 void checkDicts(BranchDescription
const& productDesc) {
25 if(productDesc.transient()) {
42 anyProductProduced_(
false),
61 checkDicts(productDesc);
62 std::pair<ProductList::iterator, bool>
ret =
66 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
67 <<
"Please modify the configuration file to use a distinct process name.\n";
83 iter->second.merge(productDesc);
92 if(it->second.branchType() == brType) {
103 if(initializeLookupInfo) {
112 <<
"cannot modify the ProductRegistry because it is frozen\n";
120 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
128 std::vector<std::string>
130 std::vector<std::string>
result;
133 ProductList::const_iterator it =
productList().begin();
136 for(; it !=
end; ++it) result.push_back(it->second.branchName());
141 std::vector<BranchDescription const*>
143 std::vector<BranchDescription const*>
result;
146 ProductList::const_iterator it =
productList().begin();
149 for(; it !=
end; ++it) result.push_back(&(it->second));
155 for(ProductList::const_iterator it = other.begin(), itEnd = other.end();
163 for(std::vector<BranchDescription>::const_iterator it = other.begin(), itEnd = other.end();
174 std::ostringstream differences;
176 ProductRegistry::ProductList::iterator
j =
productList_.begin();
177 ProductRegistry::ProductList::iterator
s =
productList_.end();
178 ProductRegistry::ProductList::const_iterator
i = other.
productList().begin();
179 ProductRegistry::ProductList::const_iterator
e = other.
productList().end();
182 while(j != s || i != e) {
183 if(j != s && j->second.produced()) {
186 }
else if(j == s || (i != e && i->first < j->first)) {
187 if(i->second.present()) {
188 differences <<
"Branch '" << i->second.branchName() <<
"' is in file '" << fileName <<
"'\n";
189 differences <<
" but not in previous files.\n";
194 }
else if(i == e || (j != s && j->first < i->first)) {
196 differences <<
"Branch '" << j->second.branchName() <<
"' is in previous files\n";
197 differences <<
" but not in file '" << fileName <<
"'.\n";
201 std::string difs =
match(j->second, i->second, fileName, parametersMustMatch);
212 return differences.str();
222 branchDesc)] =
index;
233 TempLookupMap tempProductLookupMap;
234 TempLookupMap tempElementLookupMap;
236 typedef std::set<std::string> UsedProcessNames;
237 UsedProcessNames usedProcessNames;
239 if(
i->second.produced()) {
253 if(
i->second.present()) {
256 LogWarning(
"Missing Dictionary") <<
"Could not find a Reflex dictionary for class '" <<
i->second.className()
257 <<
"'. This class was registered as one which is supposed to be held by an Event, LuminosityBlock, or Run but will not be available. "
259 " 1) was a Reflex dictionary created for the class,\n"
260 " 2) if so was the package with the dictionary linked with all plugins that use that class,\n"
261 " 3) the file is from an old release and this data type has been removed from the present release.";
264 fillLookup(type, index, pBD, tempProductLookupMap);
279 &&
bool(valueType)) {
281 fillLookup(valueType, index, pBD, tempElementLookupMap);
284 std::vector<Reflex::Type> baseTypes;
287 for(std::vector<Reflex::Type>::iterator iter = baseTypes.begin(),
288 iend = baseTypes.end();
291 fillLookup(*iter, index, pBD, tempElementLookupMap);
302 std::map<BranchID, ProductTransientIndex>::iterator itFind =
transients_.get().branchIDToIndex_.find(iID);
303 if(itFind ==
transients_.get().branchIDToIndex_.end()) {
306 return itFind->second;
311 os <<
i->second <<
"\n-----\n";
std::string const & processName() const
unsigned short BranchListIndex
void public_base_classes(const Reflex::Type &type, std::vector< Reflex::Type > &baseTypes)
bool is_RefToBaseVector(Reflex::Type const &possible_ref_vector, Reflex::Type &value_type)
void setProductProduced(BranchType branchType) const
ConstProductList & constProductList() const
void throwIfNotFrozen() const
std::vector< std::string > allBranchNames() const
bool is_PtrVector(Reflex::Type const &possible_ref_vector, Reflex::Type &value_type)
bool value_type_of(Reflex::Type const &t, Reflex::Type &found_type)
std::map< BranchKey, BranchDescription > ProductList
static ProductTransientIndex const kInvalidIndex
bool anyProducts(BranchType const brType) const
std::string const & processName() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode parametersMustMatch=BranchDescription::Permissive, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName, BranchDescription::MatchMode m)
ProductList::size_type size() const
virtual void addCalled(BranchDescription const &, bool iFromListener)
Transient< Transients > transients_
ProductList const & productList() const
TransientProductLookupMap & elementLookup() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
void checkDictionaries(std::string const &name, bool noComponents=false)
std::vector< BranchDescription const * > allBranchDescriptions() const
boost::array< bool, NumBranchTypes > productProduced_
void fillFrom(FillFromMap const &)
void print(std::ostream &os) const
static void fillLookup(Reflex::Type const &type, ProductTransientIndex const &index, ConstBranchDescription const *branchDesc, TransientProductLookupMap::FillFromMap &oMap)
void setFrozen(bool initializeLookupInfo=true) const
void initializeLookupTables() const
TransientProductLookupMap & productLookup() const
std::string wrappedClassName(std::string const &iFullName)
BranchType const & branchType() const
bool is_RefVector(Reflex::Type const &possible_ref_vector, Reflex::Type &value_type)
author Stefano ARGIRO author Bill Tanenbaum
void throwIfFrozen() const
void updateFromInput(ProductList const &other)
ProductTransientIndex indexFrom(BranchID const &iID) const
std::map< std::pair< TypeInBranchType, ConstBranchDescription const * >, ProductTransientIndex, CompareTypeInBranchTypeConstBranchDescription > FillFromMap
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
void copyProduct(BranchDescription const &productdesc)
EventID const & max(EventID const &lh, EventID const &rh)