Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-11 22:29:28

0001 #ifndef FWCore_Framework_stream_EDProducer_h
0002 #define FWCore_Framework_stream_EDProducer_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     EDProducer
0007 //
0008 /**\class edm::stream::EDProducer EDProducer.h "FWCore/Framework/interface/stream/EDProducer.h"
0009 
0010  Description: Base class for stream based EDProducers
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Thu, 01 Aug 2013 21:41:42 GMT
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 
0031   class WaitingTaskWithArenaHolder;
0032 
0033   namespace stream {
0034 
0035     template <typename... T>
0036     class EDProducer : public AbilityToImplementor<T>::Type...,
0037                        public std::conditional<CheckAbility<edm::module::Abilities::kAccumulator, T...>::kHasIt or
0038                                                    CheckAbility<edm::module::Abilities::kTransformer, T...>::kHasIt,
0039                                                impl::EmptyType,
0040                                                EDProducerBase>::type {
0041     public:
0042       using CacheTypes = CacheContexts<T...>;
0043 
0044       using GlobalCache = typename CacheTypes::GlobalCache;
0045       using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache;
0046       using RunCache = typename CacheTypes::RunCache;
0047       using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache;
0048       using RunContext = RunContextT<RunCache, GlobalCache>;
0049       using LuminosityBlockContext = LuminosityBlockContextT<LuminosityBlockCache, RunCache, GlobalCache>;
0050       using RunSummaryCache = typename CacheTypes::RunSummaryCache;
0051       using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache;
0052 
0053       using HasAbility = AbilityChecker<T...>;
0054 
0055       EDProducer() = default;
0056       EDProducer(const EDProducer&) = delete;
0057       const EDProducer& operator=(const EDProducer&) = delete;
0058 
0059       bool hasAbilityToProduceInBeginProcessBlocks() const final {
0060         return HasAbilityToProduceInBeginProcessBlocks<T...>::value;
0061       }
0062       bool hasAbilityToProduceInEndProcessBlocks() const final {
0063         return HasAbilityToProduceInEndProcessBlocks<T...>::value;
0064       }
0065 
0066       bool hasAbilityToProduceInBeginRuns() const final { return HasAbilityToProduceInBeginRuns<T...>::value; }
0067       bool hasAbilityToProduceInEndRuns() const final { return HasAbilityToProduceInEndRuns<T...>::value; }
0068 
0069       bool hasAbilityToProduceInBeginLumis() const final { return HasAbilityToProduceInBeginLumis<T...>::value; }
0070       bool hasAbilityToProduceInEndLumis() const final { return HasAbilityToProduceInEndLumis<T...>::value; }
0071 
0072     private:
0073       void doAcquire_(Event const& ev, EventSetup const& es, WaitingTaskWithArenaHolder& holder) final {
0074         doAcquireIfNeeded(this, ev, es, holder);
0075       }
0076     };
0077 
0078   }  // namespace stream
0079 }  // namespace edm
0080 
0081 #endif