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
edm::ConsumesCollector::consumes
EDGetToken consumes(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:64
edm::ConsumesCollectorESAdaptor
Definition: ConsumesCollector.h:39
edm::ConsumesCollectorESAdaptor::m_consumer
ConsumesCollector m_consumer
Definition: ConsumesCollector.h:145
edm::ConsumesCollector::mayConsume
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:76
edm::ConsumesCollectorWithTagESAdaptor::m_tag
const ESInputTag m_tag
Definition: ConsumesCollector.h:164
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ConsumesCollectorAdaptor
Definition: ConsumesCollector.h:43
edm::ConsumesCollector::consumesMany
void consumesMany(const TypeToGet &id)
Definition: ConsumesCollector.h:91
propagate_const.h
edm::ConsumesCollector::esConsumes
auto esConsumes(eventsetup::EventSetupRecordKey const &key, ESInputTag const &tag)
Definition: ConsumesCollector.h:107
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ConsumesCollector::consumesMany
void consumesMany(const TypeToGet &id)
Definition: ConsumesCollector.h:88
edm::ConsumesCollectorWithTagESAdaptor
Definition: ConsumesCollector.h:41
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::ConsumesCollectorESAdaptor::consumes
ESGetToken< TYPE, REC > consumes()
Definition: ConsumesCollector.h:135
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::ConsumesCollectorESAdaptor::ConsumesCollectorESAdaptor
ConsumesCollectorESAdaptor(ConsumesCollector iBase)
Definition: ConsumesCollector.h:143
edm::ConsumesCollector::consumes
ConsumesCollectorAdaptor< B > consumes(edm::InputTag tag)
Definition: ConsumesCollector.h:60
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::propagate_const
Definition: propagate_const.h:32
edm::ConsumesCollector::operator=
ConsumesCollector & operator=(ConsumesCollector const &)
Definition: ConsumesCollector.cc:7
edm::ConsumesCollector::esConsumes
auto esConsumes(ESInputTag const &tag)
Definition: ConsumesCollector.h:102
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
edm::ConsumesCollector::consumesMany
void consumesMany()
Definition: ConsumesCollector.h:84
edm::ConsumesCollector::m_consumer
edm::propagate_const< EDConsumerBase * > m_consumer
Definition: ConsumesCollector.h:128
edm::ConsumesCollectorAdaptor::consumes
EDGetTokenT< TYPE > consumes()
Definition: ConsumesCollector.h:171
edm::ConsumesCollectorAdaptor::m_tag
const edm::InputTag m_tag
Definition: ConsumesCollector.h:182
EDConsumerBase.h
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
edm::ConsumesCollector::mayConsume
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
Definition: ConsumesCollector.h:72
edm::ConsumesCollectorWithTagESAdaptor::consumes
ESGetToken< TYPE, REC > consumes()
Definition: ConsumesCollector.h:152
edm::ConsumesCollector::esConsumes
constexpr auto esConsumes() noexcept
Definition: ConsumesCollector.h:112
edm::ConsumesCollectorAdaptor::m_consumer
ConsumesCollector m_consumer
Definition: ConsumesCollector.h:181
edm::ConsumesCollectorAdaptor::ConsumesCollectorAdaptor
ConsumesCollectorAdaptor(ConsumesCollector iBase, edm::InputTag iTag)
Definition: ConsumesCollector.h:179
edm::EDGetToken
Definition: EDGetToken.h:35
edm::ESGetToken
Definition: EventSetup.h:48
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
edm::ConsumesCollector::ConsumesCollector
ConsumesCollector()=delete
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
edm::ConsumesCollector::mayConsume
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:79
edm::ConsumesCollectorWithTagESAdaptor::m_consumer
ConsumesCollector m_consumer
Definition: ConsumesCollector.h:163
edm::TypeToGet
Definition: TypeToGet.h:32
edm::ConsumesCollector::ConsumesCollector
ConsumesCollector(EDConsumerBase *iConsumer)
Definition: ConsumesCollector.h:125
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::ConsumesCollector::consumes
EDGetToken consumes(TypeToGet const &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:67
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ConsumesCollectorWithTagESAdaptor::ConsumesCollectorWithTagESAdaptor
ConsumesCollectorWithTagESAdaptor(ConsumesCollector iBase, ESInputTag iTag)
Definition: ConsumesCollector.h:160
edm::ConsumesCollector::esConsumes
auto esConsumes(ESInputTag tag) noexcept
Definition: ConsumesCollector.h:117