Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-14 02:38:38

0001 #ifndef FWCore_Framework_ProcessBlockPrincipal_h
0002 #define FWCore_Framework_ProcessBlockPrincipal_h
0003 
0004 /** \class edm::ProcessBlockPrincipal
0005 
0006 \author W. David Dagenhart, created 19 March, 2020
0007 
0008 */
0009 
0010 #include "FWCore/Framework/interface/Principal.h"
0011 #include "FWCore/Utilities/interface/ProductResolverIndex.h"
0012 
0013 #include <memory>
0014 #include <string>
0015 
0016 namespace edm {
0017 
0018   class ProcessConfiguration;
0019   class ProductRegistry;
0020   class WrapperBase;
0021 
0022   class ProcessBlockPrincipal : public Principal {
0023   public:
0024     template <typename FACTORY>
0025       requires(requires(FACTORY&& f, std::string const& name, ProductRegistry const& reg) { f(InProcess, name, reg); })
0026     ProcessBlockPrincipal(std::shared_ptr<ProductRegistry const> iReg,
0027                           FACTORY&& iFactory,
0028                           ProcessConfiguration const& iConfig)
0029         : ProcessBlockPrincipal(iReg, iFactory(InProcess, iConfig.processName(), *iReg), iConfig) {}
0030 
0031     void fillProcessBlockPrincipal(std::string const& processName, DelayedReader* reader = nullptr);
0032 
0033     std::string const& processName() const { return processName_; }
0034 
0035     void put(ProductResolverIndex index, std::unique_ptr<WrapperBase> edp) const;
0036 
0037     // Should only be 1 ProcessBlock needed at a time (no concurrent ProcessBlocks)
0038     unsigned int index() const { return 0; }
0039 
0040   private:
0041     ProcessBlockPrincipal(std::shared_ptr<ProductRegistry const>,
0042                           std::vector<std::shared_ptr<ProductResolverBase>>&& resolvers,
0043                           ProcessConfiguration const&);
0044     unsigned int transitionIndex_() const final;
0045 
0046     std::string processName_;
0047   };
0048 }  // namespace edm
0049 
0050 #endif  // FWCore_Framework_ProcessBlockPrincipal_h