CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
edm::SignallingProductRegistry Class Reference

#include <SignallingProductRegistry.h>

Inheritance diagram for edm::SignallingProductRegistry:
edm::ProductRegistry

Public Member Functions

SignallingProductRegistryoperator= (SignallingProductRegistry const &)=delete
 
 SignallingProductRegistry ()
 
 SignallingProductRegistry (ProductRegistry const &preg)
 
 SignallingProductRegistry (SignallingProductRegistry const &)=delete
 
- Public Member Functions inherited from edm::ProductRegistry
void addFromInput (edm::ProductRegistry const &)
 
void addLabelAlias (BranchDescription const &productdesc, std::string const &labelAlias, std::string const &instanceAlias)
 
void addProduct (BranchDescription const &productdesc, bool iFromListener=false)
 
std::vector< std::string > aliasToModules (KindOfType kindOfType, TypeID const &type, std::string_view moduleLabel, std::string_view productInstanceName) const
 
std::vector< BranchDescription const * > allBranchDescriptions () const
 
std::vector< std::string > allBranchNames () const
 
bool anyProductProduced () const
 
bool anyProducts (BranchType const brType) const
 
template<typename T >
void callForEachBranch (T const &iFunc)
 
void copyProduct (BranchDescription const &productdesc)
 
bool frozen () const
 
ProductResolverIndex const & getNextIndexValue (BranchType branchType) const
 
ProductResolverIndex indexFrom (BranchID const &iID) const
 
void initializeTransients ()
 
std::string merge (ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
 
void print (std::ostream &os) const
 
ProductList const & productList () const
 
ProductListproductListUpdator ()
 
std::shared_ptr< ProductResolverIndexHelper const > productLookup (BranchType branchType) const
 
std::shared_ptr< ProductResolverIndexHelperproductLookup (BranchType branchType)
 
bool productProduced (BranchType branchType) const
 
 ProductRegistry ()
 
 ProductRegistry (ProductList const &productList, bool toBeFrozen=true)
 
void setFrozen (bool initializeLookupInfo=true)
 
void setFrozen (std::set< TypeID > const &productTypesConsumed, std::set< TypeID > const &elementTypesConsumed, std::string const &processName)
 
void setUnscheduledProducts (std::set< std::string > const &unscheduledLabels)
 
ProductList::size_type size () const
 
void updateFromInput (ProductList const &other)
 
void updateFromInput (std::vector< BranchDescription > const &other)
 
virtual ~ProductRegistry ()
 

Public Attributes

signalslot::Signal< void(BranchDescription const &)> productAddedSignal_
 

Private Member Functions

void addCalled (BranchDescription const &, bool) override
 

Private Attributes

std::map< std::string, unsigned int > typeAddedStack_
 

Additional Inherited Members

- Public Types inherited from edm::ProductRegistry
typedef std::map< BranchKey, BranchDescription const > ConstProductList
 
typedef std::map< BranchKey, BranchDescriptionProductList
 

Detailed Description

Definition at line 32 of file SignallingProductRegistry.h.

Constructor & Destructor Documentation

◆ SignallingProductRegistry() [1/3]

edm::SignallingProductRegistry::SignallingProductRegistry ( )
inline

Definition at line 34 of file SignallingProductRegistry.h.

signalslot::Signal< void(BranchDescription const &)> productAddedSignal_
std::map< std::string, unsigned int > typeAddedStack_

◆ SignallingProductRegistry() [2/3]

edm::SignallingProductRegistry::SignallingProductRegistry ( ProductRegistry const &  preg)
inlineexplicit

Definition at line 35 of file SignallingProductRegistry.h.

36  : ProductRegistry(preg.productList(), false), productAddedSignal_(), typeAddedStack_() {}
signalslot::Signal< void(BranchDescription const &)> productAddedSignal_
std::map< std::string, unsigned int > typeAddedStack_

◆ SignallingProductRegistry() [3/3]

edm::SignallingProductRegistry::SignallingProductRegistry ( SignallingProductRegistry const &  )
delete

Member Function Documentation

◆ addCalled()

void SignallingProductRegistry::addCalled ( BranchDescription const &  iProd,
bool  iFromListener 
)
overrideprivatevirtual

Reimplemented from edm::ProductRegistry.

Definition at line 45 of file SignallingProductRegistry.cc.

References edm::BranchDescription::className(), edm::BranchDescription::dropped(), Exception, edm::BranchDescription::moduleLabel(), productAddedSignal_, edm::BranchDescription::productInstanceName(), and typeAddedStack_.

45  {
46  // Call only for present branches (part of avoiding adding type information for dropped branches)
47  if (iProd.dropped())
48  return;
49  StackGuard guard(iProd.className(), typeAddedStack_, iFromListener);
50  if (guard.numType_ > 2) {
51  throw cms::Exception("CircularReference")
52  << "Attempted to register the production of " << iProd.className() << " from module " << iProd.moduleLabel()
53  << " with product instance \"" << iProd.productInstanceName() << "\"\n"
54  << "However, this was in reaction to a registration of a production for the same type \n"
55  << "from another module who was also listening to product registrations.\n"
56  << "This can lead to circular Event::get* calls.\n"
57  << "Please reconfigure job so it does not contain both of the modules.";
58  }
59  productAddedSignal_(iProd);
60 }
signalslot::Signal< void(BranchDescription const &)> productAddedSignal_
std::map< std::string, unsigned int > typeAddedStack_

◆ operator=()

SignallingProductRegistry& edm::SignallingProductRegistry::operator= ( SignallingProductRegistry const &  )
delete

Member Data Documentation

◆ productAddedSignal_

signalslot::Signal<void(BranchDescription const&)> edm::SignallingProductRegistry::productAddedSignal_

Definition at line 37 of file SignallingProductRegistry.h.

Referenced by addCalled().

◆ typeAddedStack_

std::map<std::string, unsigned int> edm::SignallingProductRegistry::typeAddedStack_
private

Definition at line 45 of file SignallingProductRegistry.h.

Referenced by addCalled().