24 void checkDicts(BranchDescription
const& productDesc) {
25 if(productDesc.transient()) {
43 anyProductProduced_(
false),
48 missingDictionaries_() {
55 constProductList_.clear();
56 for (
size_t i = 0;
i < productProduced_.size(); ++
i) productProduced_[
i] =
false;
57 anyProductProduced_ =
false;
58 productLookup_.reset();
59 elementLookup_.reset();
60 branchIDToIndex_.clear();
62 missingDictionaries_.clear();
76 checkDicts(productDesc);
77 std::pair<ProductList::iterator, bool>
ret =
81 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
82 <<
"Please modify the configuration file to use a distinct process name.\n";
98 iter->second.merge(productDesc);
107 if(it->second.branchType() == brType) {
118 if(initializeLookupInfo) {
127 <<
"cannot modify the ProductRegistry because it is frozen\n";
135 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
143 std::vector<std::string>
145 std::vector<std::string>
result;
148 ProductList::const_iterator it =
productList().begin();
151 for(; it !=
end; ++it) result.push_back(it->second.branchName());
156 std::vector<BranchDescription const*>
158 std::vector<BranchDescription const*>
result;
161 ProductList::const_iterator it =
productList().begin();
164 for(; it !=
end; ++it) result.push_back(&(it->second));
170 for(ProductList::const_iterator it = other.begin(), itEnd = other.end();
178 for(std::vector<BranchDescription>::const_iterator it = other.begin(), itEnd = other.end();
189 std::ostringstream differences;
191 ProductRegistry::ProductList::iterator
j =
productList_.begin();
192 ProductRegistry::ProductList::iterator
s =
productList_.end();
193 ProductRegistry::ProductList::const_iterator
i = other.
productList().begin();
194 ProductRegistry::ProductList::const_iterator
e = other.
productList().end();
197 while(j != s || i != e) {
198 if(j != s && j->second.produced()) {
201 }
else if(j == s || (i != e && i->first < j->first)) {
202 if(i->second.present()) {
203 differences <<
"Branch '" << i->second.branchName() <<
"' is in file '" << fileName <<
"'\n";
204 differences <<
" but not in previous files.\n";
209 }
else if(i == e || (j != s && j->first < i->first)) {
211 differences <<
"Branch '" << j->second.branchName() <<
"' is in previous files\n";
212 differences <<
" but not in file '" << fileName <<
"'.\n";
216 std::string difs =
match(j->second, i->second, fileName, parametersMustMatch);
227 return differences.str();
237 branchDesc)] =
index;
252 TempLookupMap tempProductLookupMap;
253 TempLookupMap tempElementLookupMap;
258 if(
i->second.produced()) {
271 if(
i->second.present()) {
274 if(!
bool(type) || !bool(wrappedType)) {
275 missingDicts.insert(
i->second.className());
278 fillLookup(type, index, pBD, tempProductLookupMap);
293 &&
bool(valueType)) {
295 fillLookup(valueType, index, pBD, tempElementLookupMap);
298 std::vector<Reflex::Type> baseTypes;
301 for(std::vector<Reflex::Type>::iterator iter = baseTypes.begin(),
302 iend = baseTypes.end();
305 fillLookup(*iter, index, pBD, tempElementLookupMap);
324 return itFind->second;
329 os <<
i->second <<
"\n-----\n";
std::string const & processName() const
unsigned short BranchListIndex
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)
void public_base_classes(Reflex::Type const &type, std::vector< Reflex::Type > &baseTypes)
ProductList::size_type size() const
virtual void addCalled(BranchDescription const &, bool iFromListener)
ProductList const & productList() const
TransientProductLookupMap & elementLookup() const
const T & max(const T &a, const T &b)
std::vector< std::string > & missingDictionaries() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
StringSet & missingTypes()
std::set< std::string > StringSet
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
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
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)
std::map< BranchID, ProductTransientIndex > branchIDToIndex_
void copyProduct(BranchDescription const &productdesc)
EventID const & max(EventID const &lh, EventID const &rh)