CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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)
 
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())
 
 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_
 

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 34 of file ProducerBase.h.

Member Typedef Documentation

Definition at line 36 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:73
edm::ProducerBase::~ProducerBase ( )
virtual

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
template<typename P , typename L , typename I >
void edm::ProducerBase::commit_ ( P iPrincipal,
L *  iList,
I *  iID 
)
inlineprivate

Definition at line 69 of file ProducerBase.h.

69  {
70  iPrincipal.commit_(iList,iID);
71  }
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().

Referenced by edm::EDProducer::registerProductsAndCallbacks(), edm::EDFilter::registerProductsAndCallbacks(), edm::one::EDFilterBase::registerProductsAndCallbacks(), edm::one::EDProducerBase::registerProductsAndCallbacks(), edm::global::EDFilterBase::registerProductsAndCallbacks(), and edm::global::EDProducerBase::registerProductsAndCallbacks().

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:36
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 callWhenNewProductsRegistered_.

Referenced by registerProducts().

18  {
20  }
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:73

Friends And Related Function Documentation

friend class EDFilter
friend

Definition at line 56 of file ProducerBase.h.

friend class EDProducer
friend

Definition at line 55 of file ProducerBase.h.

friend class global::EDFilterBase
friend

Definition at line 60 of file ProducerBase.h.

friend class global::EDProducerBase
friend

Definition at line 59 of file ProducerBase.h.

friend class one::EDFilterBase
friend

Definition at line 58 of file ProducerBase.h.

friend class one::EDProducerBase
friend

Definition at line 57 of file ProducerBase.h.

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

Definition at line 61 of file ProducerBase.h.

Member Data Documentation

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

Definition at line 73 of file ProducerBase.h.

Referenced by callWhenNewProductsRegistered(), and registrationCallback().