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  {
41 
42  public:
43 
44  ConsumesCollector() = delete;
45  ConsumesCollector(ConsumesCollector const&) = default;
49 
50  // ---------- member functions ---------------------------
51  template <typename ProductType, BranchType B=InEvent>
53  return m_consumer->consumes<ProductType,B>(tag);
54  }
55 
57  return m_consumer->consumes(id,tag);
58  }
59 
60  template <BranchType B>
62  return m_consumer->consumes<B>(id,tag);
63  }
64 
65  template <typename ProductType, BranchType B=InEvent>
67  return m_consumer->mayConsume<ProductType,B>(tag);
68  }
69 
70 
72  return m_consumer->mayConsume(id,tag);
73  }
74 
75  template <BranchType B>
77  return m_consumer->mayConsume<B>(id,tag);
78  }
79 
80  template <typename ProductType, BranchType B=InEvent>
81  void consumesMany() {
82  m_consumer->consumesMany<ProductType,B>();
83  }
84 
85 
86  void consumesMany(const TypeToGet& id) {
87  m_consumer->consumesMany(id);
88  }
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  {
99  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
100  }
101 
102  template <typename ESProduct, typename ESRecord, Transition Tr = Transition::Event>
103  auto esConsumes(ESInputTag const& tag)
104  {
105  return m_consumer->esConsumes<ESProduct, ESRecord, Tr>(tag);
106  }
107 
108  template <typename ESProduct, Transition Tr = Transition::Event>
110  {
111  return m_consumer->esConsumes<ESProduct, Tr>(key, tag);
112  }
113 
114  private:
115  //only EDConsumerBase is allowed to make an instance of this class
116  friend class EDConsumerBase;
117 
119  m_consumer(iConsumer) {}
120 
121  // ---------- member data --------------------------------
123 
124  };
125 }
126 
127 
128 #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)