BaseToAdaptor

MakeModuleHelper

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
#ifndef FWCore_Framework_stream_EDProducerAdaptor_h
#define FWCore_Framework_stream_EDProducerAdaptor_h
// -*- C++ -*-
//
// Package:     FWCore/Framework
// Class  :     EDProducerAdaptor
//
/**\class edm::stream::EDProducerAdaptor EDProducerAdaptor.h "EDProducerAdaptor.h"

 Description: Adapts an edm::stream::EDProducer<> to work with an edm::Worker

 Usage:
    <usage>

*/
//
// Original Author:  Chris Jones
//         Created:  Fri, 02 Aug 2013 18:09:18 GMT
//

// system include files

// user include files
#include "FWCore/Framework/interface/stream/EDProducerAdaptorBase.h"
#include "FWCore/Framework/interface/stream/ProducingModuleAdaptor.h"
#include "FWCore/Framework/interface/maker/MakeModuleHelper.h"
// forward declarations

namespace edm {
  namespace stream {
    template <typename ABase, typename ModType>
    struct BaseToAdaptor;

    template <typename T>
    using EDProducerAdaptor = ProducingModuleAdaptor<T, EDProducerBase, EDProducerAdaptorBase>;

    template <typename ModType>
    struct BaseToAdaptor<EDProducerAdaptorBase, ModType> {
      typedef EDProducerAdaptor<ModType> Type;
    };
  }  // namespace stream

  template <>
  class MakeModuleHelper<edm::stream::EDProducerAdaptorBase> {
    typedef edm::stream::EDProducerAdaptorBase Base;

  public:
    template <typename ModType>
    static std::unique_ptr<Base> makeModule(ParameterSet const& pset) {
      typedef typename stream::BaseToAdaptor<Base, ModType>::Type Adaptor;
      auto module = std::make_unique<Adaptor>(pset);
      return std::unique_ptr<Base>(module.release());
    }
  };
}  // namespace edm

#endif