File indexing completed on 2024-04-06 12:11:56
0001 #ifndef FWCore_Framework_MayConsumeChooserBase_h
0002 #define FWCore_Framework_MayConsumeChooserBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
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
0028
0029
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
0056 virtual ESResolverIndex makeChoice(RCD const& iRecord) const = 0;
0057 };
0058 }
0059
0060 #endif