File indexing completed on 2024-04-06 12:12:00
0001 #ifndef FWCore_Framework_stream_EDProducerAdaptor_h
0002 #define FWCore_Framework_stream_EDProducerAdaptor_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/Framework/interface/stream/EDProducerAdaptorBase.h"
0025 #include "FWCore/Framework/interface/stream/ProducingModuleAdaptor.h"
0026 #include "FWCore/Framework/interface/maker/MakeModuleHelper.h"
0027
0028
0029 namespace edm {
0030 namespace stream {
0031 template <typename ABase, typename ModType>
0032 struct BaseToAdaptor;
0033
0034 template <typename T>
0035 using EDProducerAdaptor = ProducingModuleAdaptor<T, EDProducerBase, EDProducerAdaptorBase>;
0036
0037 template <typename ModType>
0038 struct BaseToAdaptor<EDProducerAdaptorBase, ModType> {
0039 typedef EDProducerAdaptor<ModType> Type;
0040 };
0041 }
0042
0043 template <>
0044 class MakeModuleHelper<edm::stream::EDProducerAdaptorBase> {
0045 typedef edm::stream::EDProducerAdaptorBase Base;
0046
0047 public:
0048 template <typename ModType>
0049 static std::unique_ptr<Base> makeModule(ParameterSet const& pset) {
0050 typedef typename stream::BaseToAdaptor<Base, ModType>::Type Adaptor;
0051 auto module = std::make_unique<Adaptor>(pset);
0052 return std::unique_ptr<Base>(module.release());
0053 }
0054 };
0055 }
0056
0057 #endif