Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:36:22

0001 #ifndef FWCore_Framework_stream_makeGlobal_h
0002 #define FWCore_Framework_stream_makeGlobal_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     makeGlobal
0007 //
0008 /** Helper functions for making stream modules
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Thu, 22 May 2014 13:55:01 GMT
0019 //
0020 
0021 #include <memory>
0022 
0023 #include "FWCore/Framework/interface/stream/dummy_helpers.h"
0024 
0025 namespace edm {
0026   class ParameterSet;
0027   namespace stream {
0028     namespace impl {
0029       template <typename T, typename G>
0030       std::unique_ptr<G> makeGlobal(edm::ParameterSet const& iPSet, G const*) {
0031         return T::initializeGlobalCache(iPSet);
0032       }
0033       template <typename T>
0034       dummy_ptr makeGlobal(edm::ParameterSet const& iPSet, void const*) {
0035         return dummy_ptr();
0036       }
0037 
0038       template <typename T, typename G>
0039       T* makeStreamModule(edm::ParameterSet const& iPSet, G const* iGlobal) {
0040         return new T(iPSet, iGlobal);
0041       }
0042 
0043       template <typename T>
0044       T* makeStreamModule(edm::ParameterSet const& iPSet, void const*) {
0045         return new T(iPSet);
0046       }
0047 
0048       template <typename G>
0049       inline std::unique_ptr<G> makeInputProcessBlockCacheImpl(G const*) {
0050         return std::make_unique<G>();
0051       }
0052 
0053       inline dummy_ptr makeInputProcessBlockCacheImpl(void const*) { return dummy_ptr(); }
0054 
0055     }  // namespace impl
0056   }  // namespace stream
0057 }  // namespace edm
0058 #endif