CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
14 
15 #include <functional>
16 #include <unordered_map>
17 #include <string>
18 #include <vector>
19 #include <array>
20 
21 namespace edm {
22  class BranchDescription;
23  class ModuleDescription;
24  class ProducesCollector;
25  class ProductRegistry;
26  class Event;
27  class LuminosityBlock;
28  class ProcessBlock;
29  class Run;
30 
31  class EDProducer;
32  class EDFilter;
33  namespace one {
34  class EDProducerBase;
35  class EDFilterBase;
36  } // namespace one
37  namespace global {
38  class EDProducerBase;
39  class EDFilterBase;
40  } // namespace global
41  namespace limited {
42  class EDProducerBase;
43  class EDFilterBase;
44  } // namespace limited
45  namespace stream {
46  template <typename T>
47  class ProducingModuleAdaptorBase;
48  }
49 
50  namespace producerbasehelper {
51  template <typename P>
53  template <>
55  static constexpr int kBranchType = InProcess;
56  };
57  template <>
58  struct PrincipalTraits<Run> {
59  static constexpr int kBranchType = InRun;
60  };
61  template <>
63  static constexpr int kBranchType = InLumi;
64  };
65  template <>
67  static constexpr int kBranchType = InEvent;
68  };
69  } // namespace producerbasehelper
70 
72  public:
74  ProducerBase();
75  ~ProducerBase() noexcept(false) override;
76 
79 
81 
84 
87  }
88 
90  std::unordered_multimap<std::string, std::tuple<edm::TypeID const*, const char*, edm::ProductResolverIndex>>;
91  void resolvePutIndicies(BranchType iBranchType,
92  ModuleToResolverIndicies const& iIndicies,
93  std::string const& moduleLabel);
94 
95  std::vector<edm::ProductResolverIndex> const& indiciesForPutProducts(BranchType iBranchType) const {
96  return putIndicies_[iBranchType];
97  }
98 
99  std::vector<edm::ProductResolverIndex> const& putTokenIndexToProductResolverIndex() const {
101  }
102 
103  protected:
106 
107  private:
108  friend class EDProducer;
109  friend class EDFilter;
110  friend class one::EDProducerBase;
111  friend class one::EDFilterBase;
113  friend class global::EDFilterBase;
115  friend class limited::EDFilterBase;
116  friend class PuttableSourceBase;
117  template <typename T>
119 
120  template <typename P>
121  void commit_(P& iPrincipal) {
123  }
124 
125  template <typename P, typename I>
126  void commit_(P& iPrincipal, I* iID) {
128  }
129 
130  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
131  std::array<std::vector<edm::ProductResolverIndex>, edm::NumBranchTypes> putIndicies_;
132  std::vector<edm::ProductResolverIndex> putTokenToResolverIndex_;
133  };
134 } // namespace edm
135 #endif
void commit_(P &iPrincipal, I *iID)
Definition: ProducerBase.h:126
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:85
std::vector< bool > const & recordProvenanceList() const
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >> ModuleToResolverIndicies
Definition: ProducerBase.h:90
ProductRegistryHelper::TypeLabelList TypeLabelList
Definition: ProducerBase.h:73
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:99
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
Definition: ProducerBase.h:130
std::array< std::vector< edm::ProductResolverIndex >, edm::NumBranchTypes > putIndicies_
Definition: ProducerBase.h:131
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
BranchType
Definition: BranchType.h:11
void resolvePutIndicies(BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
Definition: ProducerBase.cc:79
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts(BranchType iBranchType) const
Definition: ProducerBase.h:95
~ProducerBase() noexcept(false) override
Definition: ProducerBase.cc:17
std::vector< TypeLabelItem > TypeLabelList
#define override(base_class)
string function
Definition: callgraph.py:50
const std::complex< double > I
Definition: I.h:8
std::vector< edm::ProductResolverIndex > putTokenToResolverIndex_
Definition: ProducerBase.h:132
ProducesCollector producesCollector()
std::pair< OmniClusterRef, TrackingParticleRef > P
std::function< void(BranchDescription const &)> registrationCallback() const
used by the fwk to register list of products
Definition: ProducerBase.cc:19
void commit_(P &iPrincipal)
Definition: ProducerBase.h:121
Definition: Run.h:45