CMS 3D CMS Logo

ProductResolverIndexHelper.cc
Go to the documentation of this file.
1 
9 
10 #include <TClass.h>
11 
12 #include <cassert>
13 #include <iostream>
14 #include <limits>
15 
16 namespace edm {
17 
18  namespace productholderindexhelper {
19  TypeID
20  getContainedTypeFromWrapper(TypeID const& wrappedTypeID, std::string const& className) {
21  static int const vtcOffset = TClass::GetClass("edm::WrapperBase")->GetBaseClassOffset(TClass::GetClass("edm::ViewTypeChecker"));
22  static TClass const* const wbClass = TClass::GetClass("edm::WrapperBase");
23  static std::string const refVector("edm::RefVector<");
24  static std::string const refToBaseVector("edm::RefToBaseVector<");
25  static std::string const ptrVector("edm::PtrVector<");
26  static std::string const vectorPtr("std::vector<edm::Ptr<");
27  static std::string const associationMap("edm::AssociationMap<");
28  static std::string const newDetSetVector("edmNew::DetSetVector<");
29  static size_t const rvsize = refVector.size();
30  static size_t const rtbvsize = refToBaseVector.size();
31  static size_t const pvsize = ptrVector.size();
32  static size_t const vpsize = vectorPtr.size();
33  static size_t const amsize = associationMap.size();
34  static size_t const ndsize = newDetSetVector.size();
35  bool mayBeRefVector = (className.substr(0, rvsize) == refVector)
36  || (className.substr(0, rtbvsize) == refToBaseVector)
37  || (className.substr(0, pvsize) == ptrVector)
38  || (className.substr(0, vpsize) == vectorPtr);
39  // AssociationMap and edmNew::DetSetVector do not support View and
40  // this function is used to get a contained type that can be accessed
41  // using a View. So return the void type in these cases.
42  // In practice, they were the only types causing a problem, but any
43  // type with a typedef named value_type that does not support
44  // View might also cause problems and might need to be added here in
45  // the future.
46  if (className.substr(0, amsize) == associationMap ||
47  className.substr(0, ndsize) == newDetSetVector) {
48  return TypeID(typeid(void));
49  }
50  TClass* cl = TClass::GetClass(wrappedTypeID.className().c_str());
51  if(cl == nullptr) {
52  return TypeID(typeid(void));
53  }
54  void* p = cl->New();
55  int offset = cl->GetBaseClassOffset(wbClass) + vtcOffset;
56  std::unique_ptr<ViewTypeChecker> checker = getAnyPtr<ViewTypeChecker>(p, offset);
57  if(mayBeRefVector) {
58  std::type_info const& ti = checker->memberTypeInfo();
59  if(ti != typeid(void)) {
60  return TypeID(ti);
61  }
62  }
63  return TypeID(checker->valueTypeInfo());
64  }
65 
66  TypeID
67  getContainedType(TypeID const& typeID) {
68  const std::string& className = typeID.className();
69  TypeWithDict const wrappedType = TypeWithDict::byName(wrappedClassName(className));
70  TypeID const wrappedTypeID = TypeID(wrappedType.typeInfo());
71  return getContainedTypeFromWrapper(wrappedTypeID, className);
72  }
73  }
74 
76  nextIndexValue_(0),
77  beginElements_(0),
78  items_(new std::set<ProductResolverIndexHelper::Item>),
79  processItems_(new std::set<std::string>) {
80  }
81 
84  TypeID const& typeID,
85  char const* moduleLabel,
86  char const* instance,
87  char const* process) const {
88 
89  unsigned int iToIndexAndNames = indexToIndexAndNames(kindOfType,
90  typeID,
91  moduleLabel,
92  instance,
93  process);
94 
95  if (iToIndexAndNames == std::numeric_limits<unsigned int>::max()) {
97  }
98  return indexAndNames_[iToIndexAndNames].index();
99  }
100 
102  unsigned int startInIndexAndNames,
103  unsigned int numberOfMatches) :
104  productResolverIndexHelper_(productResolverIndexHelper),
105  startInIndexAndNames_(startInIndexAndNames),
106  numberOfMatches_(numberOfMatches) {
107  if (numberOfMatches != 0 && startInIndexAndNames_ + numberOfMatches_ > productResolverIndexHelper_->indexAndNames_.size()) {
109  << "ProductResolverIndexHelper::Matches::Matches - Arguments exceed vector bounds.\n";
110  }
111  }
112 
115  if (i >= numberOfMatches_) {
117  << "ProductResolverIndexHelper::Matches::index - Argument is out of range.\n";
118  }
120  }
121 
122  bool
124  if (i >= numberOfMatches_) {
126  << "ProductResolverIndexHelper::Matches::isFullyResolved - Argument is out of range.\n";
127  }
128  return (productResolverIndexHelper_->indexAndNames_[startInIndexAndNames_ + i].startInProcessNames() != 0U);
129  }
130 
131  char const*
133  if (i >= numberOfMatches_) {
135  << "ProductResolverIndexHelper::Matches::processName - Argument is out of range.\n";
136  }
137  unsigned int startInProcessNames = productResolverIndexHelper_->indexAndNames_[startInIndexAndNames_ + i].startInProcessNames();
138  return &productResolverIndexHelper_->processNames_[startInProcessNames];
139  }
140 
141  char const*
143  if (i >= numberOfMatches_) {
145  << "ProductResolverIndexHelper::Matches::moduleLabel - Argument is out of range.\n";
146  }
147  unsigned int start = productResolverIndexHelper_->indexAndNames_[startInIndexAndNames_ + i].startInBigNamesContainer();
149  }
150 
153  TypeID const& typeID,
154  char const* moduleLabel,
155  char const* instance) const {
156 
157  unsigned int startInIndexAndNames = indexToIndexAndNames(kindOfType,
158  typeID,
159  moduleLabel,
160  instance,
161  nullptr);
162  unsigned int numberOfMatches = 1;
163 
164  if (startInIndexAndNames == std::numeric_limits<unsigned int>::max()) {
165  numberOfMatches = 0;
166  } else {
167  auto vSize = indexAndNames_.size();
168  for (unsigned int j = startInIndexAndNames + 1U;
169  j < vSize && (indexAndNames_[j].startInProcessNames() != 0U);
170  ++j) {
171  ++numberOfMatches;
172  }
173  }
174  return Matches(this, startInIndexAndNames, numberOfMatches);
175  }
176 
179  TypeID const& typeID) const {
180 
181  unsigned int startInIndexAndNames = std::numeric_limits<unsigned int>::max();
182  unsigned int numberOfMatches = 0;
183 
184  // Look for the type and check to see if it found it
185  unsigned iType = indexToType(kindOfType, typeID);
187 
188  // Get the range of entries with a matching TypeID
189  Range const& range = ranges_[iType];
190 
191  startInIndexAndNames = range.begin();
192  numberOfMatches = range.end() - range.begin();
193  }
194  return Matches(this, startInIndexAndNames, numberOfMatches);
195  }
196 
199  char const* moduleLabel,
200  char const* instance,
201  char const* process,
202  TypeID const& containedTypeID,
203  std::vector<TypeWithDict>* baseTypesOfContainedType) {
204  if (!items_) {
206  << "ProductResolverIndexHelper::insert - Attempt to insert more elements after frozen.\n";
207  }
208 
209  if (process == nullptr || *process == '\0') {
211  << "ProductResolverIndexHelper::insert - Empty process.\n";
212  }
213 
214  // Throw if this has already been inserted
215  Item item(PRODUCT_TYPE, typeID, moduleLabel, instance, process, 0);
216  std::set<Item>::iterator iter = items_->find(item);
217  if (iter != items_->end()) {
219  << "ProductResolverIndexHelper::insert - Attempt to insert duplicate entry.\n";
220  }
221 
222  // Put in an entry for the product
224  unsigned int savedProductIndex = nextIndexValue_;
225  ++nextIndexValue_;
226  items_->insert(item);
227 
228  // Put in an entry for the product with an empty process name
229  // if it is not already there
230  item.clearProcess();
231  iter = items_->find(item);
232  if (iter == items_->end()) {
234  ++nextIndexValue_;
235  items_->insert(item);
236  }
237 
238  // Now put in entries for a contained class if this is a
239  // recognized container.
240  if(containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID()) {
241  TypeWithDict containedType(containedTypeID.typeInfo());
242 
243  Item containedItem(ELEMENT_TYPE, containedTypeID, moduleLabel, instance, process, savedProductIndex);
244  iter = items_->find(containedItem);
245  if (iter != items_->end()) {
246  containedItem.setIndex(ProductResolverIndexAmbiguous);
247  items_->erase(iter);
248  }
249  items_->insert(containedItem);
250 
251  containedItem.clearProcess();
252  iter = items_->find(containedItem);
253  if (iter == items_->end()) {
254  containedItem.setIndex(nextIndexValue_);
255  ++nextIndexValue_;
256  items_->insert(containedItem);
257  }
258 
259  // Repeat this for all public base classes of the contained type
260  if (baseTypesOfContainedType) {
261 
262  for(TypeWithDict const& baseType : *baseTypesOfContainedType) {
263  TypeID baseTypeID(baseType.typeInfo());
264  Item baseItem(ELEMENT_TYPE, baseTypeID, moduleLabel, instance, process, savedProductIndex);
265  iter = items_->find(baseItem);
266  if (iter != items_->end()) {
267  baseItem.setIndex(ProductResolverIndexAmbiguous);
268  items_->erase(iter);
269  }
270  items_->insert(baseItem);
271 
272  baseItem.clearProcess();
273  iter = items_->find(baseItem);
274  if (iter == items_->end()) {
275  baseItem.setIndex(nextIndexValue_);
276  ++nextIndexValue_;
277  items_->insert(baseItem);
278  }
279  }
280  }
281  }
282  return savedProductIndex;
283  }
284 
287  char const* moduleLabel,
288  char const* instance,
289  char const* process) {
290 
291  TypeID containedTypeID = productholderindexhelper::getContainedType(typeID);
292  bool hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
293  std::vector<TypeWithDict> baseTypes;
294  std::vector<TypeWithDict>* baseTypesOfContainedType = &baseTypes;
295  if (hasContainedType) {
296  std::vector<std::string> missingDictionaries;
297  public_base_classes(missingDictionaries, containedTypeID, baseTypes);
298  }
299  return insert(typeID, moduleLabel, instance, process, containedTypeID, baseTypesOfContainedType);
300  }
301 
303 
304  if (!items_) return;
305 
306  // Make a first pass and count things so we
307  // can reserve memory in the vectors. Also
308  // fill processItems_ on the first pass.
309  bool iFirstThisType = true;
310  bool beginElementsWasSet = false;
311  TypeID previousTypeID;
312  KindOfType previousKindOfType = PRODUCT_TYPE;
313  std::string previousModuleLabel;
314  std::string previousInstance;
315  unsigned int iCountTypes = 0;
316  unsigned int iCountCharacters = 0;
317  for (auto const& item : *items_) {
318 
319  if (iFirstThisType || item.typeID() != previousTypeID || item.kindOfType() != previousKindOfType) {
320  ++iCountTypes;
321  iFirstThisType = true;
322 
323  if (!beginElementsWasSet) {
324  if (item.kindOfType() == ELEMENT_TYPE) {
325  beginElementsWasSet = true;
326  } else {
327  beginElements_ = iCountTypes;
328  }
329  }
330  }
331 
332  processItems_->insert(item.process());
333 
334  if (iFirstThisType ||
335  item.moduleLabel() != previousModuleLabel ||
336  item.instance() != previousInstance) {
337  iCountCharacters += item.moduleLabel().size();
338  iCountCharacters += item.instance().size();
339  iCountCharacters += 2;
340  }
341 
342  iFirstThisType = false;
343  previousTypeID = item.typeID();
344  previousKindOfType = item.kindOfType();
345  previousModuleLabel = item.moduleLabel();
346  previousInstance = item.instance();
347  }
348 
349  // Size and fill the process name vector
350  unsigned int processNamesSize = 0;
351  for (auto const& processItem : *processItems_) {
352  processNamesSize += processItem.size();
353  ++processNamesSize;
354  }
355  processNames_.reserve(processNamesSize);
356  for (auto const& processItem : *processItems_) {
357  for (auto const& c : processItem) {
358  processNames_.push_back(c);
359  }
360  processNames_.push_back('\0');
361  lookupProcessNames_.push_back(processItem);
362  }
363 
364  // Reserve memory in the vectors
365  sortedTypeIDs_.reserve(iCountTypes);
366  ranges_.reserve(iCountTypes);
367  indexAndNames_.reserve(items_->size());
368  bigNamesContainer_.reserve(iCountCharacters);
369 
370  // Second pass. Really fill the vectors this time.
371  bool iFirstType = true;
372  iFirstThisType = true;
373  previousTypeID = TypeID();
374  unsigned int iCount = 0;
375  unsigned int iBeginning = 0;
376  iCountCharacters = 0;
377  unsigned int previousCharacterCount = 0;
378  if (!items_->empty()) {
379  for (auto const& item : *items_) {
380 
381  if (iFirstThisType || item.typeID() != previousTypeID || item.kindOfType() != previousKindOfType) {
382  iFirstThisType = true;
383  sortedTypeIDs_.push_back(item.typeID());
384  if (iFirstType) {
385  iFirstType = false;
386  } else {
387  ranges_.push_back(Range(iBeginning, iCount));
388  }
389  iBeginning = iCount;
390  }
391  ++iCount;
392 
393  if (iFirstThisType ||
394  item.moduleLabel() != previousModuleLabel ||
395  item.instance() != previousInstance) {
396 
397  unsigned int labelSize = item.moduleLabel().size();
398  for (unsigned int j = 0; j < labelSize; ++j) {
399  bigNamesContainer_.push_back(item.moduleLabel()[j]);
400  }
401  bigNamesContainer_.push_back('\0');
402 
403  unsigned int instanceSize = item.instance().size();
404  for (unsigned int j = 0; j < instanceSize; ++j) {
405  bigNamesContainer_.push_back(item.instance()[j]);
406  }
407  bigNamesContainer_.push_back('\0');
408 
409  previousCharacterCount = iCountCharacters;
410 
411  iCountCharacters += labelSize;
412  iCountCharacters += instanceSize;
413  iCountCharacters += 2;
414  }
415 
416  unsigned int processStart = processIndex(item.process().c_str());
417  if (processStart == std::numeric_limits<unsigned int>::max()) {
419  << "ProductResolverIndexHelper::setFrozen - Process not found in processNames_.\n";
420  }
421  indexAndNames_.emplace_back(item.index(), previousCharacterCount, processStart);
422 
423  iFirstThisType = false;
424  previousTypeID = item.typeID();
425  previousKindOfType = item.kindOfType();
426  previousModuleLabel = item.moduleLabel();
427  previousInstance = item.instance();
428  }
429  ranges_.push_back(Range(iBeginning, iCount));
430  }
431 
432  // Some sanity checks to protect against out of bounds vector accesses
433  // These should only fail if there is a bug. If profiling ever shows
434  // them to be expensive one might delete them.
435  sanityCheck();
436 
437  // Cleanup, do not need the temporary containers anymore
438  // propagate_const<T> has no reset() function
439  items_ = nullptr;
440  processItems_ = nullptr;
441  }
442 
443  std::vector<std::string> const& ProductResolverIndexHelper::lookupProcessNames() const {
444  if (items_) {
446  << "ProductResolverIndexHelper::lookupProcessNames - Attempt to access names before frozen.\n";
447  }
448  return lookupProcessNames_;
449  }
450 
451  unsigned int
453  TypeID const& typeID,
454  char const* moduleLabel,
455  char const* instance,
456  char const* process) const {
457 
458  // Look for the type and check to see if it found it
459  unsigned iType = indexToType(kindOfType, typeID);
461 
462  unsigned startProcess = 0;
463  if (process) {
464  startProcess = processIndex(process);
465  if (startProcess == std::numeric_limits<unsigned int>::max()) {
467  }
468  }
469 
470  ProductResolverIndexHelper::Range const& range = ranges_[iType];
471  unsigned int begin = range.begin();
472  unsigned int end = range.end();
473 
474  while (begin < end) {
475 
476  unsigned int midpoint = begin + ((end - begin) / 2);
477  char const* namePtr = &bigNamesContainer_[indexAndNames_[midpoint].startInBigNamesContainer()];
478 
479  // Compare the module label
480  char const* label = moduleLabel;
481  while (*namePtr && (*namePtr == *label)) {
482  ++namePtr; ++label;
483  }
484  if (*namePtr == *label) { // true only if both are at the '\0' at the end of the C string
485  ++namePtr; // move to the next C string
486 
487  // Compare the instance name
488  char const* instanceName = instance;
489  while (*namePtr && (*namePtr == *instanceName)) {
490  ++namePtr; ++instanceName;
491  }
492  if (*namePtr == *instanceName) {
493 
494  // Compare the process name
495  if (startProcess == indexAndNames_[midpoint].startInProcessNames()) {
496  return midpoint;
497  } else {
498  if (indexAndNames_[midpoint].startInProcessNames() > startProcess) {
499  while (true) {
500  --midpoint;
501  if (indexAndNames_[midpoint].startInProcessNames() == startProcess) {
502  return midpoint;
503  }
504  if (indexAndNames_[midpoint].startInProcessNames() == 0) break;
505  }
506  } else {
507  while (true) {
508  ++midpoint;
509  if (midpoint == indexAndNames_.size()) break;
510  if (indexAndNames_[midpoint].startInProcessNames() == 0) break;
511  if (indexAndNames_[midpoint].startInProcessNames() == startProcess) {
512  return midpoint;
513  }
514  }
515  }
516  break;
517  }
518  } else if (*namePtr < *instanceName) {
519  if (begin == midpoint) break;
520  begin = midpoint;
521  } else {
522  end = midpoint;
523  }
524  } else if (*namePtr < *label) {
525  if (begin == midpoint) break;
526  begin = midpoint;
527  } else {
528  end = midpoint;
529  }
530  } // end while (begin < end)
531  }
533  }
534 
535  unsigned int
537  TypeID const& typeID) const {
538 
539  unsigned int beginType = 0;
540  unsigned int endType = beginElements_;
541  if (kindOfType == ELEMENT_TYPE) {
542  beginType = beginElements_;
543  endType = sortedTypeIDs_.size();
544  }
545 
546  while (beginType < endType) {
547  unsigned int midpointType = beginType + ((endType - beginType) / 2);
548  if (sortedTypeIDs_[midpointType] == typeID) {
549  return midpointType; // Found it
550  } else if (sortedTypeIDs_[midpointType] < typeID) {
551  if (beginType == midpointType) break;
552  beginType = midpointType;
553  } else {
554  endType = midpointType;
555  }
556  }
557  return std::numeric_limits<unsigned int>::max(); // Failed to find it
558  }
559 
560  unsigned int ProductResolverIndexHelper::processIndex(char const* process) const {
561 
562  char const* ptr = &processNames_[0];
563  char const* begin = ptr;
564  while (true) {
565  char const* p = process;
566  char const* beginName = ptr;
567  while (*ptr && (*ptr == *p)) {
568  ++ptr; ++p;
569  }
570  if (*ptr == *p) {
571  return beginName - begin;
572  }
573  while (*ptr) {
574  ++ptr;
575  }
576  ++ptr;
577  if (static_cast<unsigned>(ptr - begin) >= processNames_.size()) {
579  }
580  }
581  return 0;
582  }
583 
586 
588  for(unsigned int i=0; i<beginElements_; ++i) {
589  auto const& range= ranges_[i];
590  for(unsigned int j=range.begin(); j<range.end();++j) {
591  auto const& indexAndNames = indexAndNames_[j];
592  if(0 == strcmp(&processNames_[indexAndNames.startInProcessNames()], iProcessName.c_str())) {
593  //The first null terminated string is the module label
594  auto pModLabel = &bigNamesContainer_[indexAndNames.startInBigNamesContainer()];
595  auto l = strlen(pModLabel);
596  auto pInstance = pModLabel+l+1;
597  result.emplace(pModLabel,
598  std::make_tuple(&sortedTypeIDs_[i],
599  pInstance,
600  indexAndNames.index()));
601  }
602  }
603  }
604  return result;
605  }
606 
607 
609  bool sanityChecksPass = true;
610  if (sortedTypeIDs_.size() != ranges_.size()) sanityChecksPass = false;
611 
612  unsigned int previousEnd = 0;
613  for ( auto const& range : ranges_) {
614  if (range.begin() != previousEnd) sanityChecksPass = false;
615  if (range.begin() >= range.end()) sanityChecksPass = false;
616  previousEnd = range.end();
617  }
618  if (previousEnd != indexAndNames_.size()) sanityChecksPass = false;
619 
620 
621  unsigned maxStart = 0;
622  unsigned maxStartProcess = 0;
623  for (auto const& indexAndName : indexAndNames_) {
624  if (indexAndName.index() >= nextIndexValue_ && indexAndName.index() != ProductResolverIndexAmbiguous) sanityChecksPass = false;
625 
626  if (indexAndName.startInBigNamesContainer() >= bigNamesContainer_.size()) sanityChecksPass = false;
627  if (indexAndName.startInProcessNames() >= processNames_.size()) sanityChecksPass = false;
628 
629  if (indexAndName.startInBigNamesContainer() > maxStart) maxStart = indexAndName.startInBigNamesContainer();
630  if (indexAndName.startInProcessNames() > maxStartProcess) maxStartProcess = indexAndName.startInProcessNames();
631  }
632 
633  if (!indexAndNames_.empty()) {
634  if (bigNamesContainer_.back() != '\0') sanityChecksPass = false;
635  if (processNames_.back() != '\0') sanityChecksPass = false;
636  if (maxStart >= bigNamesContainer_.size()) sanityChecksPass = false;
637  unsigned int countZeroes = 0;
638  for (unsigned j = maxStart; j < bigNamesContainer_.size(); ++j) {
639  if (bigNamesContainer_[j] == '\0') {
640  ++countZeroes;
641  }
642  }
643  if (countZeroes != 2) sanityChecksPass = false;
644  if (maxStartProcess >= processNames_.size()) sanityChecksPass = false;
645  countZeroes = 0;
646  for (unsigned j = maxStartProcess; j < processNames_.size(); ++j) {
647  if (processNames_[j] == '\0') {
648  ++countZeroes;
649  }
650  }
651  if (countZeroes != 1) sanityChecksPass = false;
652  }
653 
654  if (!sanityChecksPass) {
656  << "ProductResolverIndexHelper::setFrozen - Detected illegal state.\n";
657  }
658  }
659 
661  TypeID const& typeID,
662  std::string const& moduleLabel,
663  std::string const& instance,
664  std::string const& process,
666  kindOfType_(kindOfType),
667  typeID_(typeID),
668  moduleLabel_(moduleLabel),
669  instance_(instance),
670  process_(process),
671  index_(index) {
672  }
673 
674  bool
676  if (kindOfType_ < right.kindOfType_) return true;
677  if (kindOfType_ > right.kindOfType_) return false;
678  if (typeID_ < right.typeID_) return true;
679  if (typeID_ > right.typeID_) return false;
680  if (moduleLabel_ < right.moduleLabel_) return true;
681  if (moduleLabel_ > right.moduleLabel_) return false;
682  if (instance_ < right.instance_) return true;
683  if (instance_ > right.instance_) return false;
684  return process_ < right.process_;
685  }
686 
687  void ProductResolverIndexHelper::print(std::ostream& os) const {
688 
689  os << "\n******* Dump ProductResolverIndexHelper *************************\n";
690 
691  os << "\nnextIndexValue_ = " << nextIndexValue_ << "\n";
692  os << "beginElements_ = " << beginElements_ << "\n";
693 
694  os << "\n******* sortedTypeIDs_ \n";
695  for (auto const& i : sortedTypeIDs_) {
696  os << i << "\n";
697  }
698  os << "******* ranges_ \n";
699  for (auto const& i : ranges_) {
700  os << i.begin() << " " << i.end() << "\n";
701  }
702  os << "******* indexAndNames_ \n";
703  for (auto const& i : indexAndNames_) {
704  os << i.index() << " " << i.startInBigNamesContainer() << " ";
705  char const* ptr = &bigNamesContainer_[i.startInBigNamesContainer()];
706  while (*ptr) {
707  os << *ptr;
708  ++ptr;
709  }
710  ++ptr;
711  os << " ";
712  while (*ptr) {
713  os << *ptr;
714  ++ptr;
715  }
716  os << " " << i.startInProcessNames() << " ";
717  ptr = &processNames_[i.startInProcessNames()];
718  while (*ptr) {
719  os << *ptr;
720  ++ptr;
721  }
722  os << "\n";
723  }
724  os << "******* bigNamesContainer_ \n";
725  for (auto i : bigNamesContainer_) {
726  if (i == '\0') os << '\\' << '0';
727  else os << i;
728  }
729  if (!bigNamesContainer_.empty()) os << "\n";
730  os << "******* processNames_ \n";
731  for (auto i : processNames_) {
732  if (i == '\0') os << '\\' << '0';
733  else os << i;
734  }
735  if (!processNames_.empty()) os << "\n";
736  if (items_) {
737  os << "******* items_ \n";
738  for (auto const& item : *items_) {
739  std:: cout << item.kindOfType() << " " << item.moduleLabel() << " " << item.instance() << " " << item.process() << " " << item.index() << " " << item.typeID() << "\n";
740  }
741  }
742  if (processItems_) {
743  os << "******* processItems_ \n";
744  for (auto const& item : *processItems_) {
745  os << item << "\n";
746  }
747  }
748  os << "sortedTypeIDs_.size() = " << sortedTypeIDs_.size() << "\n";
749  os << "indexAndNames_.size() = " << indexAndNames_.size() << "\n";
750  os << "bigNamesContainer_.size() = " << bigNamesContainer_.size() << "\n";
751  os << "processNames_.size() = " << processNames_.size() << "\n";
752  os << "\n";
753  }
754 }
ProductResolverIndex index(unsigned int i) const
Definition: start.py:1
char const * processName(unsigned int i) const
char const * moduleLabel(unsigned int i) const
TypeID getContainedType(TypeID const &typeID)
unsigned int indexToType(KindOfType kindOfType, TypeID const &typeID) const
unsigned int ProductResolverIndex
Item(KindOfType kindOfType, TypeID const &typeID, std::string const &moduleLabel, std::string const &instance, std::string const &process, ProductResolverIndex index)
TypeID getContainedTypeFromWrapper(TypeID const &wrappedtypeID, std::string const &className)
static PFTauRenderPlugin instance
PixelRecoRange< float > Range
bool public_base_classes(std::vector< std::string > &missingDictionaries, TypeID const &typeID, std::vector< TypeWithDict > &baseTypes)
ModulesToIndiciesMap indiciesForModulesInProcess(const std::string &iProcessName) const
std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, ProductResolverIndex >> ModulesToIndiciesMap
ProductResolverIndex insert(TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process, TypeID const &containedTypeID, std::vector< TypeWithDict > *baseTypesOfContainedType)
const std::type_info & typeInfo() const
Definition: TypeIDBase.h:58
unsigned int processIndex(char const *process) const
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:59
Matches(ProductResolverIndexHelper const *productResolverIndexHelper, unsigned int startInIndexAndNames, unsigned int numberOfMatches)
edm::propagate_const< std::unique_ptr< std::set< std::string > > > processItems_
std::vector< IndexAndNames > const & indexAndNames() const
Matches relatedIndexes(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const
unsigned int indexToIndexAndNames(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) const
std::type_info const & typeInfo() const
#define end
Definition: vmac.h:39
std::vector< IndexAndNames > indexAndNames_
std::vector< std::string > lookupProcessNames_
std::string wrappedClassName(std::string const &iFullName)
#define begin
Definition: vmac.h:32
HLT enums.
std::string const & className() const
Definition: TypeID.cc:46
ProductResolverIndexHelper const * productResolverIndexHelper_
ProductResolverIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=nullptr) const
edm::propagate_const< std::unique_ptr< std::set< Item > > > items_
std::vector< std::string > const & lookupProcessNames() const
std::string className(const T &t)
Definition: ClassName.h:30