CMS 3D CMS Logo

ConsumesCollector.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ConsumesCollector_h
2 #define FWCore_Framework_ConsumesCollector_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : edm::ConsumesCollector
7 //
24 //
25 // Original Author: Chris Jones
26 // Created: Fri, 07 Jun 2013 12:44:47 GMT
27 //
28 
29 // system include files
30 
31 // user include files
34 
35 // forward declarations
36 namespace edm {
37  class EDConsumerBase;
38  template <Transition TR>
40  template <Transition TR>
42  template <BranchType B>
44 
46  public:
47  ConsumesCollector() = delete;
52 
53  // ---------- member functions ---------------------------
54  template <typename ProductType, BranchType B = InEvent>
56  return m_consumer->consumes<ProductType, B>(tag);
57  }
58 
59  template <BranchType B = InEvent>
62  }
63 
64  EDGetToken consumes(const TypeToGet& id, edm::InputTag const& tag) { return m_consumer->consumes(id, tag); }
65 
66  template <BranchType B>
68  return m_consumer->consumes<B>(id, tag);
69  }
70 
71  template <typename ProductType, BranchType B = InEvent>
73  return m_consumer->mayConsume<ProductType, B>(tag);
74  }
75 
76  EDGetToken mayConsume(const TypeToGet& id, edm::InputTag const& tag) { return m_consumer->mayConsume(id, tag); }
77 
78  template <BranchType B>
80  return m_consumer->mayConsume<B>(id, tag);
81  }
82 
83  template <typename ProductType, BranchType B = InEvent>
84  void consumesMany() {
85  m_consumer->consumesMany<ProductType, B>();
86  }
87 
88  void consumesMany(const TypeToGet& id) { m_consumer->consumesMany(id); }
89 
90  template <BranchType B>
91  void consumesMany(const TypeToGet& id) {
92  m_consumer->consumesMany<B>(id);
93  }
94 
95  // For consuming event-setup products
96  template <typename ESProduct, typename ESRecord, Transition Tr = Transition::Event>
97  auto esConsumes() {
98  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
99  }
100 
101  template <typename ESProduct, typename ESRecord, Transition Tr = Transition::Event>
102  auto esConsumes(ESInputTag const& tag) {
103  return m_consumer->esConsumes<ESProduct, ESRecord, Tr>(tag);
104  }
105 
106  template <typename ESProduct, Transition Tr = Transition::Event>
108  return m_consumer->esConsumes<ESProduct, Tr>(key, tag);
109  }
110 
111  template <Transition Tr = Transition::Event>
112  [[nodiscard]] constexpr auto esConsumes() noexcept {
113  return ConsumesCollectorESAdaptor<Tr>(*this);
114  }
115 
116  template <Transition Tr = Transition::Event>
117  [[nodiscard]] auto esConsumes(ESInputTag tag) noexcept {
119  }
120 
121  private:
122  //only EDConsumerBase is allowed to make an instance of this class
123  friend class EDConsumerBase;
124 
125  ConsumesCollector(EDConsumerBase* iConsumer) : m_consumer(iConsumer) {}
126 
127  // ---------- member data --------------------------------
129  };
130 
131  template <Transition TR>
133  public:
134  template <typename TYPE, typename REC>
136  return m_consumer.template esConsumes<TYPE, REC, TR>();
137  }
138 
139  private:
140  //only ConsumesCollector is allowed to make an instance of this class
141  friend class ConsumesCollector;
142 
144 
146  };
147 
148  template <Transition TR>
150  public:
151  template <typename TYPE, typename REC>
153  return m_consumer.template esConsumes<TYPE, REC, TR>(m_tag);
154  }
155 
156  private:
157  //only ConsumesCollector is allowed to make an instance of this class
158  friend class ConsumesCollector;
159 
161  : m_consumer(std::move(iBase)), m_tag(std::move(iTag)) {}
162 
165  };
166 
167  template <BranchType B>
169  public:
170  template <typename TYPE>
172  return m_consumer.template consumes<TYPE, B>(m_tag);
173  }
174 
175  private:
176  //only ConsumesCollector is allowed to make an instance of this class
177  friend class ConsumesCollector;
178 
180 
183  };
184 
185 } // namespace edm
186 
187 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: APVGainStruct.h:7
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
ConsumesCollector(EDConsumerBase *iConsumer)
ESGetToken< TYPE, REC > consumes()
void consumesMany(const TypeToGet &id)
edm::propagate_const< EDConsumerBase * > m_consumer
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
ConsumesCollectorAdaptor(ConsumesCollector iBase, edm::InputTag iTag)
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
EDGetToken consumes(const TypeToGet &id, edm::InputTag const &tag)
auto esConsumes(ESInputTag tag) noexcept
ConsumesCollector & operator=(ConsumesCollector const &)
void consumesMany(const TypeToGet &id)
ConsumesCollectorWithTagESAdaptor(ConsumesCollector iBase, ESInputTag iTag)
constexpr auto esConsumes() noexcept
EDGetToken consumes(TypeToGet const &id, edm::InputTag const &tag)
HLT enums.
auto esConsumes(ESInputTag const &tag)
ConsumesCollectorAdaptor< B > consumes(edm::InputTag tag)
def move(src, dest)
Definition: eostools.py:511
auto esConsumes(eventsetup::EventSetupRecordKey const &key, ESInputTag const &tag)
EDGetTokenT< TYPE > consumes()
ConsumesCollectorESAdaptor(ConsumesCollector iBase)