CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
edm::ProductHolderIndexHelper Class Reference

#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 (TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process, TypeID const &containedTypeID)
 
ProductHolderIndex insert (TypeID const &typeID, 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< IndexAndNamesindexAndNames_
 
edm::propagate_const
< std::unique_ptr< std::set
< Item > > > 
items_
 
std::vector< std::string > lookupProcessNames_
 
ProductHolderIndex nextIndexValue_
 
edm::propagate_const
< std::unique_ptr< std::set
< std::string > > > 
processItems_
 
std::vector< char > processNames_
 
std::vector< Rangeranges_
 
std::vector< TypeIDsortedTypeIDs_
 

Detailed Description

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.

Author
W. David Dagenhart, created 10 December, 2012

Definition at line 85 of file ProductHolderIndexHelper.h.

Constructor & Destructor Documentation

edm::ProductHolderIndexHelper::ProductHolderIndexHelper ( )

Definition at line 60 of file ProductHolderIndexHelper.cc.

Member Function Documentation

unsigned int edm::ProductHolderIndexHelper::beginElements ( ) const
inline

Definition at line 219 of file ProductHolderIndexHelper.h.

ProductHolderIndex edm::ProductHolderIndexHelper::index ( KindOfType  kindOfType,
TypeID const &  typeID,
char const *  moduleLabel,
char const *  instance,
char const *  process = 0 
) const

Definition at line 68 of file ProductHolderIndexHelper.cc.

std::vector<IndexAndNames> const& edm::ProductHolderIndexHelper::indexAndNames ( ) const
inline

Definition at line 222 of file ProductHolderIndexHelper.h.

unsigned int edm::ProductHolderIndexHelper::indexToIndexAndNames ( KindOfType  kindOfType,
TypeID const &  typeID,
char const *  moduleLabel,
char const *  instance,
char const *  process 
) const

Definition at line 420 of file ProductHolderIndexHelper.cc.

unsigned int edm::ProductHolderIndexHelper::indexToType ( KindOfType  kindOfType,
TypeID const &  typeID 
) const

Definition at line 504 of file ProductHolderIndexHelper.cc.

ProductHolderIndex edm::ProductHolderIndexHelper::insert ( TypeID const &  typeID,
char const *  moduleLabel,
char const *  instance,
char const *  process,
TypeID const &  containedTypeID 
)

Definition at line 183 of file ProductHolderIndexHelper.cc.

ProductHolderIndex edm::ProductHolderIndexHelper::insert ( TypeID const &  typeID,
char const *  moduleLabel,
char const *  instance,
char const *  process 
)
inline

Definition at line 182 of file ProductHolderIndexHelper.h.

std::vector< std::string > const & edm::ProductHolderIndexHelper::lookupProcessNames ( ) const

Definition at line 411 of file ProductHolderIndexHelper.cc.

ProductHolderIndex edm::ProductHolderIndexHelper::nextIndexValue ( ) const
inline

Definition at line 247 of file ProductHolderIndexHelper.h.

void edm::ProductHolderIndexHelper::print ( std::ostream &  os) const

Definition at line 631 of file ProductHolderIndexHelper.cc.

unsigned int edm::ProductHolderIndexHelper::processIndex ( char const *  process) const

Definition at line 528 of file ProductHolderIndexHelper.cc.

std::vector<char> const& edm::ProductHolderIndexHelper::processNames ( ) const
inline

Definition at line 223 of file ProductHolderIndexHelper.h.

std::vector<Range> const& edm::ProductHolderIndexHelper::ranges ( ) const
inline

Definition at line 221 of file ProductHolderIndexHelper.h.

ProductHolderIndexHelper::Matches edm::ProductHolderIndexHelper::relatedIndexes ( KindOfType  kindOfType,
TypeID const &  typeID,
char const *  moduleLabel,
char const *  instance 
) const

Definition at line 137 of file ProductHolderIndexHelper.cc.

ProductHolderIndexHelper::Matches edm::ProductHolderIndexHelper::relatedIndexes ( KindOfType  kindOfType,
TypeID const &  typeID 
) const

Definition at line 163 of file ProductHolderIndexHelper.cc.

void edm::ProductHolderIndexHelper::sanityCheck ( ) const

Definition at line 552 of file ProductHolderIndexHelper.cc.

void edm::ProductHolderIndexHelper::setFrozen ( )

Definition at line 270 of file ProductHolderIndexHelper.cc.

std::vector<TypeID> const& edm::ProductHolderIndexHelper::sortedTypeIDs ( ) const
inline

Definition at line 220 of file ProductHolderIndexHelper.h.

Member Data Documentation

unsigned int edm::ProductHolderIndexHelper::beginElements_
private

Definition at line 261 of file ProductHolderIndexHelper.h.

std::vector<char> edm::ProductHolderIndexHelper::bigNamesContainer_
private

Definition at line 299 of file ProductHolderIndexHelper.h.

std::vector<IndexAndNames> edm::ProductHolderIndexHelper::indexAndNames_
private

Definition at line 287 of file ProductHolderIndexHelper.h.

edm::propagate_const<std::unique_ptr<std::set<Item> > > edm::ProductHolderIndexHelper::items_
private

Definition at line 338 of file ProductHolderIndexHelper.h.

std::vector<std::string> edm::ProductHolderIndexHelper::lookupProcessNames_
private

Definition at line 304 of file ProductHolderIndexHelper.h.

ProductHolderIndex edm::ProductHolderIndexHelper::nextIndexValue_
private

Definition at line 256 of file ProductHolderIndexHelper.h.

edm::propagate_const<std::unique_ptr<std::set<std::string> > > edm::ProductHolderIndexHelper::processItems_
private

Definition at line 340 of file ProductHolderIndexHelper.h.

std::vector<char> edm::ProductHolderIndexHelper::processNames_
private

Definition at line 300 of file ProductHolderIndexHelper.h.

std::vector<Range> edm::ProductHolderIndexHelper::ranges_
private

Definition at line 275 of file ProductHolderIndexHelper.h.

std::vector<TypeID> edm::ProductHolderIndexHelper::sortedTypeIDs_
private

Definition at line 268 of file ProductHolderIndexHelper.h.