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