Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-13 23:27:02

0001 #ifndef FWCore_Framework_stream_EDFilterAdaptor_h
0002 #define FWCore_Framework_stream_EDFilterAdaptor_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     EDFilterAdaptor
0007 //
0008 /**\class edm::stream::EDFilterAdaptor EDFilterAdaptor.h "EDFilterAdaptor.h"
0009 
0010  Description: Adapts an edm::stream::EDFilter<> to work with an edm::Worker
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri, 02 Aug 2013 18:09:18 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/stream/EDFilterAdaptorBase.h"
0025 #include "FWCore/Framework/interface/stream/ProducingModuleAdaptor.h"
0026 #include "FWCore/Framework/interface/maker/MakeModuleHelper.h"
0027 
0028 // forward declarations
0029 
0030 namespace edm {
0031   namespace stream {
0032 
0033     template <typename T>
0034     using EDFilterAdaptor = ProducingModuleAdaptor<T, EDFilterBase, EDFilterAdaptorBase>;
0035 
0036     template <typename ABase, typename ModType>
0037     struct BaseToAdaptor;
0038 
0039     template <typename ModType>
0040     struct BaseToAdaptor<EDFilterAdaptorBase, ModType> {
0041       typedef EDFilterAdaptor<ModType> Type;
0042     };
0043   }  // namespace stream
0044 
0045   template <>
0046   class MakeModuleHelper<edm::stream::EDFilterAdaptorBase> {
0047     typedef edm::stream::EDFilterAdaptorBase Base;
0048 
0049   public:
0050     template <typename ModType>
0051     static std::unique_ptr<Base> makeModule(ParameterSet const& pset) {
0052       typedef typename stream::BaseToAdaptor<Base, ModType>::Type Adaptor;
0053       auto module = std::make_unique<Adaptor>(pset);
0054       return std::unique_ptr<Base>(module.release());
0055     }
0056   };
0057 
0058 }  // namespace edm
0059 
0060 #endif