File indexing completed on 2025-01-11 03:38:17
0001 #ifndef FWCore_Framework_stream_EDProducer_h
0002 #define FWCore_Framework_stream_EDProducer_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "FWCore/Framework/interface/Frameworkfwd.h"
0022 #include "FWCore/Framework/interface/stream/AbilityToImplementor.h"
0023 #include "FWCore/Framework/interface/stream/CacheContexts.h"
0024 #include "FWCore/Framework/interface/stream/Contexts.h"
0025 #include "FWCore/Framework/interface/stream/AbilityChecker.h"
0026 #include "FWCore/Framework/interface/stream/EDProducerBase.h"
0027 #include "FWCore/Framework/interface/stream/ProducingModuleHelper.h"
0028
0029 namespace edm {
0030 namespace stream {
0031 template <typename... T>
0032 class EDProducer : public AbilityToImplementor<T>::Type...,
0033 public std::conditional<CheckAbility<edm::module::Abilities::kAccumulator, T...>::kHasIt or
0034 CheckAbility<edm::module::Abilities::kTransformer, T...>::kHasIt,
0035 impl::EmptyType,
0036 EDProducerBase>::type {
0037 public:
0038 using CacheTypes = CacheContexts<T...>;
0039
0040 using GlobalCache = typename CacheTypes::GlobalCache;
0041 using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache;
0042 using RunCache = typename CacheTypes::RunCache;
0043 using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache;
0044 using RunContext = RunContextT<RunCache, GlobalCache>;
0045 using LuminosityBlockContext = LuminosityBlockContextT<LuminosityBlockCache, RunCache, GlobalCache>;
0046 using RunSummaryCache = typename CacheTypes::RunSummaryCache;
0047 using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache;
0048
0049 using HasAbility = AbilityChecker<T...>;
0050
0051 EDProducer() = default;
0052 EDProducer(const EDProducer&) = delete;
0053 const EDProducer& operator=(const EDProducer&) = delete;
0054
0055 bool hasAbilityToProduceInBeginProcessBlocks() const final {
0056 return HasAbilityToProduceInBeginProcessBlocks<T...>::value;
0057 }
0058 bool hasAbilityToProduceInEndProcessBlocks() const final {
0059 return HasAbilityToProduceInEndProcessBlocks<T...>::value;
0060 }
0061
0062 bool hasAbilityToProduceInBeginRuns() const final { return HasAbilityToProduceInBeginRuns<T...>::value; }
0063 bool hasAbilityToProduceInEndRuns() const final { return HasAbilityToProduceInEndRuns<T...>::value; }
0064
0065 bool hasAbilityToProduceInBeginLumis() const final { return HasAbilityToProduceInBeginLumis<T...>::value; }
0066 bool hasAbilityToProduceInEndLumis() const final { return HasAbilityToProduceInEndLumis<T...>::value; }
0067
0068 private:
0069 void doAcquire_(Event const& ev, EventSetup const& es, WaitingTaskHolder&& holder) final {
0070 doAcquireIfNeeded(this, ev, es, std::move(holder));
0071 }
0072 };
0073 }
0074 }
0075
0076 #endif