#include <FWCore/Framework/interface/ProducerBase.h>
Public Types | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Member Functions | |
ProducerBase () | |
void | registerProducts (boost::shared_ptr< ProducerBase >, ProductRegistry *, ModuleDescription const &) |
virtual | ~ProducerBase () |
Protected Member Functions | |
template<class TProducer, class TMethod> | |
void | callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod) |
Private Attributes | |
boost::function< void(const BranchDescription &)> | callWhenNewProductsRegistered_ |
Definition at line 23 of file ProducerBase.h.
edm::ProducerBase::ProducerBase | ( | ) |
Definition at line 17 of file ProducerBase.cc.
00017 : ProductRegistryHelper(), callWhenNewProductsRegistered_() {}
edm::ProducerBase::~ProducerBase | ( | ) | [virtual] |
void edm::ProducerBase::callWhenNewProductsRegistered | ( | TProducer * | iProd, | |
TMethod | iMethod | |||
) | [inline, protected] |
Definition at line 41 of file ProducerBase.h.
References callWhenNewProductsRegistered_.
00041 { 00042 callWhenNewProductsRegistered_ = boost::bind(iMethod,iProd,_1); 00043 }
void edm::ProducerBase::registerProducts | ( | boost::shared_ptr< ProducerBase > | producer, | |
ProductRegistry * | iReg, | |||
ModuleDescription const & | md | |||
) |
Definition at line 62 of file ProducerBase.cc.
References edm::ProductRegistryHelper::addToRegistry(), edm::ProductRegistry::callForEachBranch(), empty, and edm::ProductRegistryHelper::typeLabelList().
Referenced by edm::EDProducer::registerAnyProducts(), and edm::EDFilter::registerAnyProducts().
00065 { 00066 if (typeLabelList().empty() && registrationCallback().empty()) { 00067 return; 00068 } 00069 //If we have a callback, first tell the callback about all the entries already in the 00070 // product registry, then add any items this producer wants to add to the registry 00071 // and only after that do we register the callback. This is done so the callback does not 00072 // get called for items registered by this producer (avoids circular reference problems) 00073 bool isListener = false; 00074 if(!(registrationCallback().empty())) { 00075 isListener=true; 00076 iReg->callForEachBranch(registrationCallback()); 00077 } 00078 TypeLabelList const& plist = typeLabelList(); 00079 00080 ProductRegistryHelper::addToRegistry(plist.begin(), plist.end(), md, *(iReg), isListener); 00081 if(!(registrationCallback().empty())) { 00082 Service<ConstProductRegistry> regService; 00083 regService->watchProductAdditions(CallbackWrapper(producer, registrationCallback(), iReg, md)); 00084 } 00085 }
boost::function<void(const BranchDescription&)> edm::ProducerBase::callWhenNewProductsRegistered_ [private] |