Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:56

0001 #ifndef FWCore_Framework_MayConsumeChooserBase_h
0002 #define FWCore_Framework_MayConsumeChooserBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     MayConsumeChooserBase
0007 //
0008 /**\class MayConsumeChooserBase MayConsumeChooserBase.h "MayConsumeChooserBase.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Thu, 19 Sep 2019 15:29:33 GMT
0019 //
0020 
0021 // system include files
0022 #include "FWCore/Framework/interface/ESTagGetter.h"
0023 #include "FWCore/Framework/interface/DataKey.h"
0024 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0025 #include "FWCore/Utilities/interface/ESIndices.h"
0026 
0027 // user include files
0028 
0029 // forward declarations
0030 
0031 namespace edm::eventsetup::impl {
0032 
0033   class MayConsumeChooserCore {
0034   public:
0035     virtual ~MayConsumeChooserCore() = default;
0036 
0037     virtual EventSetupRecordKey recordKey() const noexcept = 0;
0038     virtual TypeTag productType() const noexcept = 0;
0039 
0040     void setTagGetter(ESTagGetter iGetter) { getter_ = std::move(iGetter); }
0041 
0042   protected:
0043     ESTagGetter const& tagGetter() const { return getter_; }
0044 
0045   private:
0046     ESTagGetter getter_;
0047   };
0048 
0049   template <typename RCD>
0050   class MayConsumeChooserBase : public MayConsumeChooserCore {
0051   public:
0052     MayConsumeChooserBase() = default;
0053     ~MayConsumeChooserBase() override = default;
0054 
0055     // ---------- const member functions ---------------------
0056     virtual ESResolverIndex makeChoice(RCD const& iRecord) const = 0;
0057   };
0058 }  // namespace edm::eventsetup::impl
0059 
0060 #endif