EDProducer

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
#ifndef FWCore_Framework_stream_EDProducer_h
#define FWCore_Framework_stream_EDProducer_h
// -*- C++ -*-
//
// Package:     FWCore/Framework
// Class  :     EDProducer
//
/**\class edm::stream::EDProducer EDProducer.h "FWCore/Framework/interface/stream/EDProducer.h"

 Description: Base class for stream based EDProducers

 Usage:
    <usage>

*/
//
// Original Author:  Chris Jones
//         Created:  Thu, 01 Aug 2013 21:41:42 GMT
//

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/AbilityToImplementor.h"
#include "FWCore/Framework/interface/stream/CacheContexts.h"
#include "FWCore/Framework/interface/stream/Contexts.h"
#include "FWCore/Framework/interface/stream/AbilityChecker.h"
#include "FWCore/Framework/interface/stream/EDProducerBase.h"
#include "FWCore/Framework/interface/stream/ProducingModuleHelper.h"

namespace edm {
  namespace stream {
    template <typename... T>
    class EDProducer : public AbilityToImplementor<T>::Type...,
                       public std::conditional<CheckAbility<edm::module::Abilities::kAccumulator, T...>::kHasIt or
                                                   CheckAbility<edm::module::Abilities::kTransformer, T...>::kHasIt,
                                               impl::EmptyType,
                                               EDProducerBase>::type {
    public:
      using CacheTypes = CacheContexts<T...>;

      using GlobalCache = typename CacheTypes::GlobalCache;
      using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache;
      using RunCache = typename CacheTypes::RunCache;
      using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache;
      using RunContext = RunContextT<RunCache, GlobalCache>;
      using LuminosityBlockContext = LuminosityBlockContextT<LuminosityBlockCache, RunCache, GlobalCache>;
      using RunSummaryCache = typename CacheTypes::RunSummaryCache;
      using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache;

      using HasAbility = AbilityChecker<T...>;

      EDProducer() = default;
      EDProducer(const EDProducer&) = delete;
      const EDProducer& operator=(const EDProducer&) = delete;

      bool hasAbilityToProduceInBeginProcessBlocks() const final {
        return HasAbilityToProduceInBeginProcessBlocks<T...>::value;
      }
      bool hasAbilityToProduceInEndProcessBlocks() const final {
        return HasAbilityToProduceInEndProcessBlocks<T...>::value;
      }

      bool hasAbilityToProduceInBeginRuns() const final { return HasAbilityToProduceInBeginRuns<T...>::value; }
      bool hasAbilityToProduceInEndRuns() const final { return HasAbilityToProduceInEndRuns<T...>::value; }

      bool hasAbilityToProduceInBeginLumis() const final { return HasAbilityToProduceInBeginLumis<T...>::value; }
      bool hasAbilityToProduceInEndLumis() const final { return HasAbilityToProduceInEndLumis<T...>::value; }

    private:
      void doAcquire_(Event const& ev, EventSetup const& es, WaitingTaskHolder&& holder) final {
        doAcquireIfNeeded(this, ev, es, std::move(holder));
      }
    };
  }  // namespace stream
}  // namespace edm

#endif