#include <ProductResolverIndexHelper.h>
Classes | |
class | IndexAndNames |
class | Item |
class | Matches |
class | Range |
Public Types | |
using | ModulesToIndiciesMap = std::unordered_multimap< std::string, ProductResolverIndex > |
Public Member Functions | |
unsigned int | beginElements () const |
ProductResolverIndex | index (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=0) const |
std::vector< IndexAndNames > const & | indexAndNames () const |
unsigned int | indexToIndexAndNames (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) const |
unsigned int | indexToType (KindOfType kindOfType, TypeID const &typeID) const |
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) |
ProductResolverIndex | insert (TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) |
std::vector< std::string > const & | lookupProcessNames () const |
ProductResolverIndex | nextIndexValue () const |
void | print (std::ostream &os) const |
unsigned int | processIndex (char const *process) const |
std::vector< char > const & | processNames () const |
ProductResolverIndexHelper () | |
std::vector< Range > const & | ranges () const |
Matches | relatedIndexes (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const |
Matches | relatedIndexes (KindOfType kindOfType, TypeID const &typeID) const |
void | sanityCheck () const |
void | setFrozen () |
std::vector< TypeID > const & | sortedTypeIDs () const |
Private Attributes | |
unsigned int | beginElements_ |
std::vector< char > | bigNamesContainer_ |
std::vector< IndexAndNames > | indexAndNames_ |
edm::propagate_const< std::unique_ptr< std::set< Item > > > | items_ |
std::vector< std::string > | lookupProcessNames_ |
ProductResolverIndex | nextIndexValue_ |
edm::propagate_const< std::unique_ptr< std::set< std::string > > > | processItems_ |
std::vector< char > | processNames_ |
std::vector< Range > | ranges_ |
std::vector< TypeID > | sortedTypeIDs_ |
This class assigns and gets the ProductResolverIndex associated with a type, module label, instance, and process. The ProductResolverIndex is used to tell the Principal where to store a ProductResolver and how to find it quickly.
One can also look up the same ProductResolverIndex's using the type or base type of an element in a container in the product (if the product is a container). In this case the KindOfType argument to the Principal::getByLabel function is ELEMENT_TYPE, whereas normally it is PRODUCT_TYPE.
There are also special ProductResolverIndex's generated where the process name is empty. These indexes refer to a special ProductResolvers that search for a matching product from the most recent process that has a matching type, label and instance. There is ProductResolverIndex generated for each type/label/instance combination which has at least one entry in the tables in this class. Both PRODUCT_TYPEs and ELEMENT_TYPEs get these special ProductResolvers.
The ProductResolverIndex for a particular product will not change during a process after the ProductRegistry has been frozen. Nor will any of the other member data of this class. Multiple threads can access it concurrently without problems. The ProductResolverIndexes can be safely cached in InputTags and possibly other places, because they never change within a process. The ProductResolverIndex for a particular product is not intended to be persistent and will be different in different processes.
The ProductResolverIndex is used to order the placement of the ProductResolvers in the Principal that are either present in the input or produced in the current process. Be aware that there are other ProductResolvers for products that come after ProductResolvers placed by this class. For example, the placement of dropped products is not handled by this class, instead by the ProductRegistry. The reason for this distinction is that those other ProductResolvers can change and be added as a process runs. The content of this class never changes after the ProductRegistry is frozen.
Definition at line 88 of file ProductResolverIndexHelper.h.
using edm::ProductResolverIndexHelper::ModulesToIndiciesMap = std::unordered_multimap<std::string,ProductResolverIndex> |
Definition at line 123 of file ProductResolverIndexHelper.h.
edm::ProductResolverIndexHelper::ProductResolverIndexHelper | ( | ) |
Definition at line 75 of file ProductResolverIndexHelper.cc.
|
inline |
Definition at line 224 of file ProductResolverIndexHelper.h.
ProductResolverIndex edm::ProductResolverIndexHelper::index | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process = 0 |
||
) | const |
Definition at line 83 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), hpstanc_transforms::max, and edm::ProductResolverIndexInvalid.
Referenced by edm::Principal::findProductByLabel(), edm::PrincipalGetAdapter::getBranchDescription(), BeautifulSoup.PageElement::insert(), edm::EDConsumerBase::modulesWhoseProductsAreConsumed(), and edm::EDConsumerBase::updateLookup().
|
inline |
Definition at line 227 of file ProductResolverIndexHelper.h.
Referenced by indiciesForModulesInProcess().
unsigned int edm::ProductResolverIndexHelper::indexToIndexAndNames | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) | const |
Definition at line 452 of file ProductResolverIndexHelper.cc.
References begin, edm::ProductResolverIndexHelper::Range::begin(), bigNamesContainer_, end, edm::ProductResolverIndexHelper::Range::end(), indexAndNames_, indexToType(), instance, MuonErrorMatrixAdjuster_cfi::instanceName, diffTwoXMLs::label, hpstanc_transforms::max, edm::ProductResolverIndexHelper::Matches::moduleLabel(), processIndex(), and ranges_.
Referenced by index(), and relatedIndexes().
unsigned int edm::ProductResolverIndexHelper::indexToType | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 536 of file ProductResolverIndexHelper.cc.
References beginElements_, edm::ELEMENT_TYPE, hpstanc_transforms::max, and sortedTypeIDs_.
Referenced by indexToIndexAndNames(), and relatedIndexes().
ProductResolverIndexHelper::ModulesToIndiciesMap edm::ProductResolverIndexHelper::indiciesForModulesInProcess | ( | const std::string & | iProcessName | ) | const |
Definition at line 585 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, mps_fire::i, indexAndNames(), indexAndNames_, processNames_, ranges_, and mps_fire::result.
ProductResolverIndex edm::ProductResolverIndexHelper::insert | ( | TypeID const & | typeID, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process, | ||
TypeID const & | containedTypeID, | ||
std::vector< TypeWithDict > * | baseTypesOfContainedType | ||
) |
Definition at line 198 of file ProductResolverIndexHelper.cc.
References edm::ProductResolverIndexHelper::Item::clearProcess(), edm::ELEMENT_TYPE, Exception, items_, edm::errors::LogicError, nextIndexValue_, edm::PRODUCT_TYPE, edm::ProductResolverIndexAmbiguous, edm::ProductResolverIndexHelper::Item::setIndex(), and edm::TypeIDBase::typeInfo().
Referenced by BeautifulSoup.PageElement::append(), and insert().
ProductResolverIndex edm::ProductResolverIndexHelper::insert | ( | TypeID const & | typeID, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) |
Definition at line 286 of file ProductResolverIndexHelper.cc.
References edm::productholderindexhelper::getContainedType(), insert(), and edm::public_base_classes().
Referenced by BeautifulSoup.PageElement::append().
std::vector< std::string > const & edm::ProductResolverIndexHelper::lookupProcessNames | ( | ) | const |
Definition at line 443 of file ProductResolverIndexHelper.cc.
References Exception, items_, edm::errors::LogicError, and lookupProcessNames_.
|
inline |
Definition at line 252 of file ProductResolverIndexHelper.h.
References edm::print().
void edm::ProductResolverIndexHelper::print | ( | std::ostream & | os | ) | const |
Definition at line 681 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, gather_cfg::cout, mps_fire::i, indexAndNames_, items_, nextIndexValue_, processItems_, processNames_, ranges_, and sortedTypeIDs_.
unsigned int edm::ProductResolverIndexHelper::processIndex | ( | char const * | process | ) | const |
Definition at line 560 of file ProductResolverIndexHelper.cc.
References begin, hpstanc_transforms::max, AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::process, and processNames_.
Referenced by indexToIndexAndNames(), and setFrozen().
|
inline |
Definition at line 228 of file ProductResolverIndexHelper.h.
References LaserDQM_cfg::process.
|
inline |
Definition at line 226 of file ProductResolverIndexHelper.h.
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance | ||
) | const |
Definition at line 152 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), edm::ProductResolverIndexHelper::Matches::Matches(), hpstanc_transforms::max, edm::ProductResolverIndexHelper::Matches::numberOfMatches(), and mitigatedMETSequence_cff::U.
Referenced by edm::Principal::getManyByType(), edm::EDConsumerBase::modulesWhoseProductsAreConsumed(), and edm::EDConsumerBase::updateLookup().
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 178 of file ProductResolverIndexHelper.cc.
References edm::ProductResolverIndexHelper::Range::begin(), edm::ProductResolverIndexHelper::Range::end(), indexToType(), edm::ProductResolverIndexHelper::Matches::Matches(), hpstanc_transforms::max, edm::ProductResolverIndexHelper::Matches::numberOfMatches(), and ranges_.
void edm::ProductResolverIndexHelper::sanityCheck | ( | ) | const |
Definition at line 602 of file ProductResolverIndexHelper.cc.
References bigNamesContainer_, Exception, indexAndNames_, edm::errors::LogicError, nextIndexValue_, processNames_, edm::ProductResolverIndexAmbiguous, ranges_, and sortedTypeIDs_.
Referenced by setFrozen().
void edm::ProductResolverIndexHelper::setFrozen | ( | ) |
Definition at line 302 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, EnergyCorrector::c, edm::ELEMENT_TYPE, Exception, indexAndNames_, items_, edm::errors::LogicError, lookupProcessNames_, hpstanc_transforms::max, processIndex(), processItems_, processNames_, edm::PRODUCT_TYPE, ranges_, sanityCheck(), sortedTypeIDs_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inline |
Definition at line 225 of file ProductResolverIndexHelper.h.
|
private |
Definition at line 266 of file ProductResolverIndexHelper.h.
Referenced by indexToType(), indiciesForModulesInProcess(), print(), and setFrozen().
|
private |
Definition at line 304 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), edm::ProductResolverIndexHelper::Matches::moduleLabel(), print(), sanityCheck(), and setFrozen().
|
private |
Definition at line 292 of file ProductResolverIndexHelper.h.
Referenced by index(), edm::ProductResolverIndexHelper::Matches::index(), indexToIndexAndNames(), indiciesForModulesInProcess(), edm::ProductResolverIndexHelper::Matches::isFullyResolved(), edm::ProductResolverIndexHelper::Matches::Matches(), edm::ProductResolverIndexHelper::Matches::moduleLabel(), print(), edm::ProductResolverIndexHelper::Matches::processName(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 343 of file ProductResolverIndexHelper.h.
Referenced by insert(), lookupProcessNames(), print(), and setFrozen().
|
private |
Definition at line 309 of file ProductResolverIndexHelper.h.
Referenced by lookupProcessNames(), and setFrozen().
|
private |
Definition at line 261 of file ProductResolverIndexHelper.h.
Referenced by insert(), print(), and sanityCheck().
|
private |
Definition at line 345 of file ProductResolverIndexHelper.h.
Referenced by print(), and setFrozen().
|
private |
Definition at line 305 of file ProductResolverIndexHelper.h.
Referenced by indiciesForModulesInProcess(), print(), processIndex(), edm::ProductResolverIndexHelper::Matches::processName(), sanityCheck(), and setFrozen().
|
private |
Definition at line 280 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), print(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 273 of file ProductResolverIndexHelper.h.
Referenced by indexToType(), print(), sanityCheck(), and setFrozen().