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 
40  public:
41  ConsumesCollector() = delete;
42  ConsumesCollector(ConsumesCollector const&) = default;
46 
47  // ---------- member functions ---------------------------
48  template <typename ProductType, BranchType B = InEvent>
50  return m_consumer->consumes<ProductType, B>(tag);
51  }
52 
53  EDGetToken consumes(const TypeToGet& id, edm::InputTag const& tag) { return m_consumer->consumes(id, tag); }
54 
55  template <BranchType B>
57  return m_consumer->consumes<B>(id, tag);
58  }
59 
60  template <typename ProductType, BranchType B = InEvent>
62  return m_consumer->mayConsume<ProductType, B>(tag);
63  }
64 
65  EDGetToken mayConsume(const TypeToGet& id, edm::InputTag const& tag) { return m_consumer->mayConsume(id, tag); }
66 
67  template <BranchType B>
69  return m_consumer->mayConsume<B>(id, tag);
70  }
71 
72  template <typename ProductType, BranchType B = InEvent>
73  void consumesMany() {
74  m_consumer->consumesMany<ProductType, B>();
75  }
76 
77  void consumesMany(const TypeToGet& id) { m_consumer->consumesMany(id); }
78 
79  template <BranchType B>
80  void consumesMany(const TypeToGet& id) {
81  m_consumer->consumesMany<B>(id);
82  }
83 
84  // For consuming event-setup products
85  template <typename ESProduct, typename ESRecord, Transition Tr = Transition::Event>
86  auto esConsumes() {
87  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
88  }
89 
90  template <typename ESProduct, typename ESRecord, Transition Tr = Transition::Event>
91  auto esConsumes(ESInputTag const& tag) {
92  return m_consumer->esConsumes<ESProduct, ESRecord, Tr>(tag);
93  }
94 
95  template <typename ESProduct, Transition Tr = Transition::Event>
97  return m_consumer->esConsumes<ESProduct, Tr>(key, tag);
98  }
99 
100  private:
101  //only EDConsumerBase is allowed to make an instance of this class
102  friend class EDConsumerBase;
103 
104  ConsumesCollector(EDConsumerBase* iConsumer) : m_consumer(iConsumer) {}
105 
106  // ---------- member data --------------------------------
108  };
109 } // namespace edm
110 
111 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ConsumesCollector & operator=(ConsumesCollector const &)=default
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
ConsumesCollector(EDConsumerBase *iConsumer)
void consumesMany(const TypeToGet &id)
edm::propagate_const< EDConsumerBase * > m_consumer
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
EDGetToken consumes(const TypeToGet &id, edm::InputTag const &tag)
static const std::string B
void consumesMany(const TypeToGet &id)
EDGetToken consumes(TypeToGet const &id, edm::InputTag const &tag)
HLT enums.
auto esConsumes(ESInputTag const &tag)
auto esConsumes(eventsetup::EventSetupRecordKey const &key, ESInputTag const &tag)