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;
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
edm::ConsumesCollector::consumes
EDGetToken consumes(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:53
edm::ConsumesCollector::mayConsume
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:65
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ConsumesCollector::consumesMany
void consumesMany(const TypeToGet &id)
Definition: ConsumesCollector.h:80
propagate_const.h
edm::ConsumesCollector::esConsumes
auto esConsumes(eventsetup::EventSetupRecordKey const &key, ESInputTag const &tag)
Definition: ConsumesCollector.h:96
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ConsumesCollector::consumesMany
void consumesMany(const TypeToGet &id)
Definition: ConsumesCollector.h:77
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:86
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::EDConsumerBase
Definition: EDConsumerBase.h:62
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:91
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
edm::ConsumesCollector::consumesMany
void consumesMany()
Definition: ConsumesCollector.h:73
edm::ConsumesCollector::m_consumer
edm::propagate_const< EDConsumerBase * > m_consumer
Definition: ConsumesCollector.h:107
EDConsumerBase.h
edm::ConsumesCollector::mayConsume
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
Definition: ConsumesCollector.h:61
edm::EDGetToken
Definition: EDGetToken.h:35
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
edm::ConsumesCollector::ConsumesCollector
ConsumesCollector()=delete
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
edm::ConsumesCollector::mayConsume
EDGetToken mayConsume(const TypeToGet &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:68
edm::TypeToGet
Definition: TypeToGet.h:32
edm::ConsumesCollector::ConsumesCollector
ConsumesCollector(EDConsumerBase *iConsumer)
Definition: ConsumesCollector.h:104
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::ConsumesCollector::consumes
EDGetToken consumes(TypeToGet const &id, edm::InputTag const &tag)
Definition: ConsumesCollector.h:56
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39