Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:02

0001 #ifndef FWCore_ServiceRegistry_ServiceMakerBase_h
0002 #define FWCore_ServiceRegistry_ServiceMakerBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     ServiceRegistry
0006 // Class  :     ServiceMakerBase
0007 //
0008 /**\class ServiceMakerBase ServiceMakerBase.h FWCore/ServiceRegistry/interface/ServiceMakerBase.h
0009 
0010  Description: Base class for Service Makers
0011 
0012  Usage:
0013     Internal detail of implementation of the ServiceRegistry system
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Mon Sep  5 13:33:00 EDT 2005
0019 //
0020 
0021 #include <typeinfo>
0022 
0023 // forward declarations
0024 namespace edm {
0025   class ParameterSet;
0026   class ActivityRegistry;
0027 
0028   namespace service {
0029     inline bool isProcessWideService(void const* /*service*/) { return false; }
0030   }  // namespace service
0031 
0032   namespace serviceregistry {
0033     class SaveConfiguration;
0034     class ServiceWrapperBase;
0035     class ServicesManager;
0036 
0037     class ServiceMakerBase {
0038     public:
0039       ServiceMakerBase();
0040       ServiceMakerBase(ServiceMakerBase const&) = delete;                   // stop default
0041       ServiceMakerBase const& operator=(ServiceMakerBase const&) = delete;  // stop default
0042       virtual ~ServiceMakerBase();
0043 
0044       // ---------- const member functions ---------------------
0045       virtual std::type_info const& serviceType() const = 0;
0046 
0047       virtual bool make(ParameterSet const&, ActivityRegistry&, ServicesManager&) const = 0;
0048 
0049       virtual bool processWideService() const = 0;
0050 
0051       virtual bool saveConfiguration() const = 0;
0052 
0053       // ---------- static member functions --------------------
0054 
0055       // ---------- member functions ---------------------------
0056 
0057     protected:
0058       bool testSaveConfiguration(SaveConfiguration const*) const { return true; }
0059       bool testSaveConfiguration(void const*) const { return false; }
0060 
0061     private:
0062       // ---------- member data --------------------------------
0063     };
0064   }  // namespace serviceregistry
0065 }  // namespace edm
0066 
0067 #endif