CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProducerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ProducerBase_h
2 #define FWCore_Framework_ProducerBase_h
3 
4 /*----------------------------------------------------------------------
5 
6 EDProducer: The base class of all "modules" that will insert new
7 EDProducts into an Event.
8 
9 ----------------------------------------------------------------------*/
10 
12 
13 #include <functional>
14 
15 namespace edm {
16  class BranchDescription;
17  class ModuleDescription;
18  class ProductRegistry;
19 
20  class EDProducer;
21  class EDFilter;
22  namespace one {
23  class EDProducerBase;
24  class EDFilterBase;
25  }
26  namespace global {
27  class EDProducerBase;
28  class EDFilterBase;
29  }
30  namespace stream {
31  template<typename T> class ProducingModuleAdaptorBase;
32  }
33 
35  public:
37  ProducerBase ();
38  virtual ~ProducerBase();
39 
41  std::function<void(BranchDescription const&)> registrationCallback() const;
42 
45  ModuleDescription const&);
46 
49 
50  protected:
53  }
54 
55  private:
56  friend class EDProducer;
57  friend class EDFilter;
58  friend class one::EDProducerBase;
59  friend class one::EDFilterBase;
60  friend class global::EDProducerBase;
61  friend class global::EDFilterBase;
62  template<typename T> friend class stream::ProducingModuleAdaptorBase;
63 
64  template< typename P>
65  void commit_(P& iPrincipal) {
66  iPrincipal.commit_();
67  }
68 
69  template< typename P, typename L, typename I>
70  void commit_(P& iPrincipal, L* iList, I* iID) {
71  iPrincipal.commit_(iList,iID);
72  }
73 
74  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
75  };
76 }
77 #endif
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:51
std::list< TypeLabelItem > TypeLabelList
ProductRegistryHelper::TypeLabelList TypeLabelList
Definition: ProducerBase.h:36
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:60
#define P
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:74
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
helper::RootFunctionHelper< F, args >::root_function function(F &f)
Definition: rootFunction.h:14
TypeLabelItem const & produces()
declare what type of product will make and with which optional label
const std::complex< double > I
Definition: I.h:8
virtual ~ProducerBase()
Definition: ProducerBase.cc:16
void commit_(P &iPrincipal, L *iList, I *iID)
Definition: ProducerBase.h:70
std::function< void(BranchDescription const &)> registrationCallback() const
used by the fwk to register list of products
Definition: ProducerBase.cc:18
void commit_(P &iPrincipal)
Definition: ProducerBase.h:65