CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::ProducerBase Class Reference

#include <ProducerBase.h>

Inheritance diagram for edm::ProducerBase:
edm::ProductRegistryHelper edm::EDFilter edm::EDProducer edm::global::EDFilterBase edm::global::EDProducerBase edm::one::EDFilterBase edm::one::EDProducerBase edm::stream::EDFilterBase edm::stream::EDProducerBase

Public Types

typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 

Public Member Functions

void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 

Private Member Functions

template<typename P >
void commit_ (P &iPrincipal)
 
template<typename P , typename L , typename I >
void commit_ (P &iPrincipal, L *iList, I *iID)
 
- Private Member Functions inherited from edm::ProductRegistryHelper
template<class ProductType >
TypeLabelItem const & produces ()
 declare what type of product will make and with which optional label More...
 
template<class ProductType >
TypeLabelItem const & produces (std::string const &instanceName)
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces ()
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces (std::string const &instanceName)
 
template<typename ProductType , Transition B>
TypeLabelItem const & produces ()
 
template<typename ProductType , Transition B>
TypeLabelItem const & produces (std::string const &instanceName)
 
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
template<BranchType B>
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
template<Transition B>
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
 ProductRegistryHelper ()
 
TypeLabelListtypeLabelList ()
 used by the fwk to register the list of products of this module More...
 
 ~ProductRegistryHelper ()
 

Private Attributes

std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
 
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypesputIndicies_
 

Friends

class EDFilter
 
class EDProducer
 
class global::EDFilterBase
 
class global::EDProducerBase
 
class one::EDFilterBase
 
class one::EDProducerBase
 
template<typename T >
class stream::ProducingModuleAdaptorBase
 

Additional Inherited Members

- Private Types inherited from edm::ProductRegistryHelper
typedef std::list< TypeLabelItemTypeLabelList
 
- Static Private Member Functions inherited from edm::ProductRegistryHelper
static void addToRegistry (TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
 

Detailed Description

Definition at line 55 of file ProducerBase.h.

Member Typedef Documentation

Definition at line 57 of file ProducerBase.h.

Constructor & Destructor Documentation

edm::ProducerBase::ProducerBase ( )

Definition at line 15 of file ProducerBase.cc.

std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:101
edm::ProducerBase::~ProducerBase ( )
virtualnoexcept

Definition at line 16 of file ProducerBase.cc.

16 { }

Member Function Documentation

void edm::ProducerBase::callWhenNewProductsRegistered ( std::function< void(BranchDescription const &)> const &  func)
inline
template<typename P >
void edm::ProducerBase::commit_ ( P iPrincipal)
inlineprivate

Definition at line 92 of file ProducerBase.h.

Referenced by edm::EDProducer::doBeginLuminosityBlock(), edm::EDFilter::doBeginLuminosityBlock(), edm::one::EDFilterBase::doBeginLuminosityBlock(), edm::one::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDFilterBase::doBeginLuminosityBlock(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::one::EDFilterBase::doBeginRun(), edm::one::EDProducerBase::doBeginRun(), edm::global::EDProducerBase::doBeginRun(), edm::global::EDFilterBase::doBeginRun(), edm::EDProducer::doEndLuminosityBlock(), edm::EDFilter::doEndLuminosityBlock(), edm::one::EDFilterBase::doEndLuminosityBlock(), edm::one::EDProducerBase::doEndLuminosityBlock(), edm::global::EDFilterBase::doEndLuminosityBlock(), edm::global::EDProducerBase::doEndLuminosityBlock(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), edm::one::EDFilterBase::doEndRun(), edm::one::EDProducerBase::doEndRun(), edm::global::EDProducerBase::doEndRun(), edm::global::EDFilterBase::doEndRun(), edm::EDProducer::doEvent(), edm::EDFilter::doEvent(), edm::one::EDFilterBase::doEvent(), edm::global::EDFilterBase::doEvent(), edm::one::EDProducerBase::doEvent(), and edm::global::EDProducerBase::doEvent().

92  {
93  iPrincipal.commit_(putIndicies_[producerbasehelper::PrincipalTraits<P>::kBranchType]);
94  }
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:102
template<typename P , typename L , typename I >
void edm::ProducerBase::commit_ ( P iPrincipal,
L *  iList,
I *  iID 
)
inlineprivate

Definition at line 97 of file ProducerBase.h.

97  {
98  iPrincipal.commit_(putIndicies_[producerbasehelper::PrincipalTraits<P>::kBranchType], iList,iID);
99  }
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:102
std::vector<edm::ProductResolverIndex> const& edm::ProducerBase::indiciesForPutProducts ( BranchType  iBranchType) const
inline

Definition at line 79 of file ProducerBase.h.

Referenced by edm::WorkerT< T >::updateLookup().

79  {
80  return putIndicies_[iBranchType];
81  }
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:102
void edm::ProducerBase::registerProducts ( ProducerBase producer,
ProductRegistry iReg,
ModuleDescription const &  md 
)

Definition at line 60 of file ProducerBase.cc.

References edm::ProductRegistryHelper::addToRegistry(), edm::ProductRegistry::callForEachBranch(), relativeConstraints::empty, registrationCallback(), and edm::ProductRegistryHelper::typeLabelList().

63  {
65  return;
66  }
67  //If we have a callback, first tell the callback about all the entries already in the
68  // product registry, then add any items this producer wants to add to the registry
69  // and only after that do we register the callback. This is done so the callback does not
70  // get called for items registered by this producer (avoids circular reference problems)
71  bool isListener = false;
72  if(registrationCallback()) {
73  isListener=true;
74  iReg->callForEachBranch(registrationCallback());
75  }
76  TypeLabelList const& plist = typeLabelList();
77 
78  ProductRegistryHelper::addToRegistry(plist.begin(), plist.end(), md, *(iReg), isListener);
79  if(registrationCallback()) {
81  regService->watchProductAdditions(CallbackWrapper(producer, registrationCallback(), iReg, md));
82  }
83  }
ProductRegistryHelper::TypeLabelList TypeLabelList
Definition: ProducerBase.h:57
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
std::function< void(BranchDescription const &)> registrationCallback() const
used by the fwk to register list of products
Definition: ProducerBase.cc:18
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
std::function< void(BranchDescription const &)> edm::ProducerBase::registrationCallback ( ) const

used by the fwk to register list of products

Definition at line 18 of file ProducerBase.cc.

References edm::ProductRegistryHelper::addToRegistry(), callWhenNewProductsRegistered_, RecoTauPiZeroBuilderPlugins_cfi::function, and edm::ProductRegistryHelper::typeLabelList().

Referenced by registerProducts().

18  {
20  }
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:101
void edm::ProducerBase::resolvePutIndicies ( BranchType  iBranchType,
std::unordered_multimap< std::string, edm::ProductResolverIndex > const &  iIndicies,
std::string const &  moduleLabel 
)

Definition at line 85 of file ProducerBase.cc.

References putIndicies_.

Referenced by edm::WorkerT< T >::updateLookup().

87  {
88  auto range = iIndicies.equal_range(moduleLabel);
89  putIndicies_[iBranchType].reserve(iIndicies.count(moduleLabel));
90  for(auto it = range.first; it != range.second;++it) {
91  putIndicies_[iBranchType].push_back(it->second);
92  }
93  }
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:102

Friends And Related Function Documentation

friend class EDFilter
friend

Definition at line 84 of file ProducerBase.h.

friend class EDProducer
friend

Definition at line 83 of file ProducerBase.h.

friend class global::EDFilterBase
friend

Definition at line 88 of file ProducerBase.h.

friend class global::EDProducerBase
friend

Definition at line 87 of file ProducerBase.h.

friend class one::EDFilterBase
friend

Definition at line 86 of file ProducerBase.h.

friend class one::EDProducerBase
friend

Definition at line 85 of file ProducerBase.h.

template<typename T >
friend class stream::ProducingModuleAdaptorBase
friend

Definition at line 89 of file ProducerBase.h.

Member Data Documentation

std::function<void(BranchDescription const&)> edm::ProducerBase::callWhenNewProductsRegistered_
private

Definition at line 101 of file ProducerBase.h.

Referenced by registrationCallback().

std::array<std::vector<edm::ProductResolverIndex>, edm::NumBranchTypes> edm::ProducerBase::putIndicies_
private

Definition at line 102 of file ProducerBase.h.

Referenced by resolvePutIndicies().