CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/FWCore/Framework/interface/ConsumesCollector.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_ConsumesCollector_h
00002 #define FWCore_Framework_ConsumesCollector_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     FWCore/Framework
00006 // Class  :     edm::ConsumesCollector
00007 // 
00018 //
00019 // Original Author:  Chris Jones
00020 //         Created:  Fri, 07 Jun 2013 12:44:47 GMT
00021 //
00022 
00023 // system include files
00024 
00025 // user include files
00026 #include "FWCore/Framework/interface/EDConsumerBase.h"
00027 
00028 // forward declarations
00029 namespace edm {
00030   class EDConsumerBase;
00031   
00032   class ConsumesCollector
00033   {
00034     
00035   public:
00036     //virtual ~ConsumesCollector();
00037     ConsumesCollector(ConsumesCollector&& iOther): m_consumer(iOther.m_consumer){}
00038     
00039     // ---------- member functions ---------------------------
00040     template <typename ProductType, BranchType B=InEvent>
00041     EDGetTokenT<ProductType> consumes(edm::InputTag const& tag) {
00042       return m_consumer->consumes<ProductType,B>(tag);
00043     }
00044     
00045     EDGetToken consumes(const TypeToGet& id, edm::InputTag const& tag) {
00046       return m_consumer->consumes(id,tag);
00047     }
00048     
00049     template <BranchType B>
00050     EDGetToken consumes(TypeToGet const& id, edm::InputTag const& tag) {
00051       return m_consumer->consumes<B>(id,tag);
00052     }
00053     
00054     template <typename ProductType, BranchType B=InEvent>
00055     EDGetTokenT<ProductType> mayConsume(edm::InputTag const& tag) {
00056       return m_consumer->mayConsume<ProductType,B>(tag);
00057     }
00058     
00059     
00060     EDGetToken mayConsume(const TypeToGet& id, edm::InputTag const& tag) {
00061       return m_consumer->mayConsume(id,tag);
00062     }
00063     
00064     template <BranchType B>
00065     EDGetToken mayConsume(const TypeToGet& id, edm::InputTag const& tag) {
00066       return m_consumer->mayConsume<B>(id,tag);
00067     }
00068     
00069     template <typename ProductType, BranchType B=InEvent>
00070     void consumesMany() {
00071       m_consumer->consumesMany<ProductType,B>();
00072     }
00073     
00074     
00075     void consumesMany(const TypeToGet& id) {
00076       m_consumer->consumesMany(id);
00077     }
00078     
00079     template <BranchType B>
00080     void consumesMany(const TypeToGet& id) {
00081       m_consumer->consumesMany<B>(id);
00082     }
00083     
00084 
00085   private:
00086     //only EDConsumerBase is allowed to make an instance of this class
00087     friend class EDConsumerBase;
00088     
00089     ConsumesCollector(EDConsumerBase* iConsumer):
00090     m_consumer(iConsumer) {}
00091 
00092     ConsumesCollector() = delete;
00093     ConsumesCollector(const ConsumesCollector&) = delete; // stop default
00094     
00095     const ConsumesCollector& operator=(const ConsumesCollector&) = delete; // stop default
00096     
00097     // ---------- member data --------------------------------
00098     EDConsumerBase* m_consumer;
00099     
00100   };
00101 }
00102 
00103 
00104 #endif