#include <ProductHolderIndexHelper.h>
Classes | |
class | IndexAndNames |
class | Item |
class | Matches |
class | Range |
Public Member Functions | |
unsigned int | beginElements () const |
ProductHolderIndex | 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 |
ProductHolderIndex | insert (TypeWithDict const &typeWithDict, char const *moduleLabel, char const *instance, char const *process) |
std::vector< std::string > const & | lookupProcessNames () const |
ProductHolderIndex | nextIndexValue () const |
void | print (std::ostream &os) const |
unsigned int | processIndex (char const *process) const |
std::vector< char > const & | processNames () const |
ProductHolderIndexHelper () | |
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_ |
std::unique_ptr< std::set< Item > > | items_ |
std::vector< std::string > | lookupProcessNames_ |
ProductHolderIndex | nextIndexValue_ |
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 ProductHolderIndex associated with a type, module label, instance, and process. The ProductHolderIndex is used to tell the Principal where to store a ProductHolder and how to find it quickly.
One can also look up the same ProductHolderIndex'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 ProductHolderIndex's generated where the process name is empty. These indexes refer to a special ProductHolders that search for a matching product from the most recent process that has a matching type, label and instance. There is ProductHolderIndex 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 ProductHolders.
The ProductHolderIndex 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 ProductHolderIndexes can be safely cached in InputTags and possibly other places, because they never change within a process. The ProductHolderIndex for a particular product is not intended to be persistent and will be different in different processes.
The ProductHolderIndex is used to order the placement of the ProductHolders in the Principal that are either present in the input or produced in the current process. Be aware that there are other ProductHolders for products that come after ProductHolders 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 ProductHolders can change and be added as a process runs. The content of this class never changes after the ProductRegistry is frozen.
Definition at line 67 of file ProductHolderIndexHelper.h.
edm::ProductHolderIndexHelper::ProductHolderIndexHelper | ( | ) |
Definition at line 12 of file ProductHolderIndexHelper.cc.
|
inline |
Definition at line 190 of file ProductHolderIndexHelper.h.
References beginElements_.
ProductHolderIndex edm::ProductHolderIndexHelper::index | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process = 0 |
||
) | const |
Definition at line 20 of file ProductHolderIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), bookConverter::max, and edm::ProductHolderIndexInvalid.
Referenced by BeautifulSoup.PageElement::_invert(), edm::Principal::findProductByLabel(), edm::PrincipalGetAdapter::getBranchDescription(), and edm::EDConsumerBase::updateLookup().
|
inline |
Definition at line 193 of file ProductHolderIndexHelper.h.
References indexAndNames_.
unsigned int edm::ProductHolderIndexHelper::indexToIndexAndNames | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) | const |
Definition at line 357 of file ProductHolderIndexHelper.cc.
References begin, edm::ProductHolderIndexHelper::Range::begin(), bigNamesContainer_, end, edm::ProductHolderIndexHelper::Range::end(), indexAndNames_, indexToType(), instance, diffTwoXMLs::label, bookConverter::max, processIndex(), and ranges_.
Referenced by index(), and relatedIndexes().
unsigned int edm::ProductHolderIndexHelper::indexToType | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 441 of file ProductHolderIndexHelper.cc.
References beginElements_, edm::ELEMENT_TYPE, bookConverter::max, and sortedTypeIDs_.
Referenced by indexToIndexAndNames(), and relatedIndexes().
ProductHolderIndex edm::ProductHolderIndexHelper::insert | ( | TypeWithDict const & | typeWithDict, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) |
Definition at line 115 of file ProductHolderIndexHelper.cc.
References edm::ELEMENT_TYPE, edm::hlt::Exception, edm::is_PtrVector(), edm::is_RefToBaseVector(), edm::is_RefVector(), items_, getDQMSummary::iter, edm::errors::LogicError, nextIndexValue_, edm::PRODUCT_TYPE, edm::ProductHolderIndexAmbiguous, edm::public_base_classes(), edm::TypeWithDict::typeInfo(), and edm::value_type_of().
Referenced by BeautifulSoup.PageElement::_invert().
std::vector< std::string > const & edm::ProductHolderIndexHelper::lookupProcessNames | ( | ) | const |
Definition at line 348 of file ProductHolderIndexHelper.cc.
References edm::hlt::Exception, items_, edm::errors::LogicError, and lookupProcessNames_.
|
inline |
Definition at line 218 of file ProductHolderIndexHelper.h.
References nextIndexValue_.
void edm::ProductHolderIndexHelper::print | ( | std::ostream & | os | ) | const |
Definition at line 568 of file ProductHolderIndexHelper.cc.
References beginElements_, bigNamesContainer_, gather_cfg::cout, i, indexAndNames_, items_, nextIndexValue_, processItems_, processNames_, ranges_, and sortedTypeIDs_.
unsigned int edm::ProductHolderIndexHelper::processIndex | ( | char const * | process | ) | const |
Definition at line 465 of file ProductHolderIndexHelper.cc.
References begin, bookConverter::max, AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::process, and processNames_.
Referenced by indexToIndexAndNames(), and setFrozen().
|
inline |
Definition at line 194 of file ProductHolderIndexHelper.h.
References processNames_.
|
inline |
Definition at line 192 of file ProductHolderIndexHelper.h.
References ranges_.
ProductHolderIndexHelper::Matches edm::ProductHolderIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance | ||
) | const |
Definition at line 69 of file ProductHolderIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), j, and bookConverter::max.
Referenced by edm::Principal::findProductByLabel(), edm::Principal::getManyByType(), and edm::EDConsumerBase::updateLookup().
ProductHolderIndexHelper::Matches edm::ProductHolderIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 95 of file ProductHolderIndexHelper.cc.
References edm::ProductHolderIndexHelper::Range::begin(), edm::ProductHolderIndexHelper::Range::end(), indexToType(), bookConverter::max, and ranges_.
void edm::ProductHolderIndexHelper::sanityCheck | ( | ) | const |
Definition at line 489 of file ProductHolderIndexHelper.cc.
References bigNamesContainer_, edm::hlt::Exception, indexAndNames_, j, edm::errors::LogicError, nextIndexValue_, processNames_, edm::ProductHolderIndexAmbiguous, ranges_, and sortedTypeIDs_.
Referenced by setFrozen().
void edm::ProductHolderIndexHelper::setFrozen | ( | ) |
Definition at line 208 of file ProductHolderIndexHelper.cc.
References beginElements_, bigNamesContainer_, trackerHits::c, edm::ELEMENT_TYPE, edm::hlt::Exception, indexAndNames_, items_, j, edm::errors::LogicError, lookupProcessNames_, bookConverter::max, processIndex(), processItems_, processNames_, edm::PRODUCT_TYPE, ranges_, sanityCheck(), sortedTypeIDs_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inline |
Definition at line 191 of file ProductHolderIndexHelper.h.
References sortedTypeIDs_.
|
private |
Definition at line 232 of file ProductHolderIndexHelper.h.
Referenced by beginElements(), indexToType(), print(), and setFrozen().
|
private |
Definition at line 270 of file ProductHolderIndexHelper.h.
Referenced by indexToIndexAndNames(), print(), sanityCheck(), and setFrozen().
|
private |
Definition at line 258 of file ProductHolderIndexHelper.h.
Referenced by index(), indexAndNames(), indexToIndexAndNames(), edm::ProductHolderIndexHelper::Matches::Matches(), print(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 309 of file ProductHolderIndexHelper.h.
Referenced by insert(), lookupProcessNames(), print(), and setFrozen().
|
private |
Definition at line 275 of file ProductHolderIndexHelper.h.
Referenced by lookupProcessNames(), and setFrozen().
|
private |
Definition at line 227 of file ProductHolderIndexHelper.h.
Referenced by insert(), nextIndexValue(), print(), and sanityCheck().
|
private |
Definition at line 311 of file ProductHolderIndexHelper.h.
Referenced by print(), and setFrozen().
|
private |
Definition at line 271 of file ProductHolderIndexHelper.h.
Referenced by print(), processIndex(), processNames(), sanityCheck(), and setFrozen().
|
private |
Definition at line 246 of file ProductHolderIndexHelper.h.
Referenced by indexToIndexAndNames(), print(), ranges(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 239 of file ProductHolderIndexHelper.h.
Referenced by indexToType(), print(), sanityCheck(), setFrozen(), and sortedTypeIDs().