Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-04 22:45:02

0001 #ifndef FWCore_Framework_ScheduleItems_h
0002 #define FWCore_Framework_ScheduleItems_h
0003 
0004 #include "FWCore/Framework/interface/Schedule.h"
0005 #include "FWCore/Common/interface/FWCoreCommonFwd.h"
0006 #include "FWCore/ServiceRegistry/interface/ServiceLegacy.h"
0007 #include "FWCore/ServiceRegistry/interface/ServiceToken.h"
0008 #include "FWCore/Utilities/interface/get_underlying_safe.h"
0009 #include "FWCore/Utilities/interface/propagate_const.h"
0010 
0011 #include <memory>
0012 #include <vector>
0013 
0014 namespace edm {
0015   class ExceptionToActionTable;
0016   class ActivityRegistry;
0017   class BranchIDListHelper;
0018   class ThinnedAssociationsHelper;
0019   struct CommonParams;
0020   class SubProcess;
0021   class ParameterSet;
0022   class ProcessConfiguration;
0023   class ProcessContext;
0024   class ProductRegistry;
0025   class SignallingProductRegistry;
0026   class StreamID;
0027   class PreallocationConfiguration;
0028   class SubProcessParentageHelper;
0029   namespace service {
0030     class TriggerNamesService;
0031   }
0032 
0033   struct ScheduleItems {
0034     ScheduleItems();
0035 
0036     ScheduleItems(ProductRegistry const& preg,
0037                   SubProcess const& om,
0038                   SubProcessBlockHelper& subProcessBlockHelper,
0039                   ProcessBlockHelperBase const& parentProcessBlockHelper);
0040 
0041     ScheduleItems(ScheduleItems const&) = delete;             // Disallow copying and moving
0042     ScheduleItems& operator=(ScheduleItems const&) = delete;  // Disallow copying and moving
0043 
0044     ServiceToken initServices(std::vector<ParameterSet>& servicePSets,
0045                               ParameterSet& processPSet,
0046                               ServiceToken const& iToken,
0047                               serviceregistry::ServiceLegacy iLegacy,
0048                               bool associate);
0049 
0050     ServiceToken addCPRandTNS(ParameterSet const& parameterSet, ServiceToken const& token);
0051 
0052     std::shared_ptr<CommonParams> initMisc(ParameterSet& parameterSet);
0053 
0054     std::unique_ptr<Schedule> initSchedule(ParameterSet& parameterSet,
0055                                            bool hasSubprocesses,
0056                                            PreallocationConfiguration const& iAllocConfig,
0057                                            ProcessContext const*,
0058                                            ProcessBlockHelperBase& processBlockHelper);
0059 
0060     class MadeModules {
0061       friend struct ScheduleItems;
0062       explicit MadeModules(std::unique_ptr<Schedule> iSched) : m_schedule(std::move(iSched)) {}
0063 
0064       std::unique_ptr<Schedule> m_schedule;
0065 
0066     public:
0067       MadeModules() = delete;
0068     };
0069 
0070     MadeModules initModules(ParameterSet& parameterSet,
0071                             service::TriggerNamesService const& tns,
0072                             PreallocationConfiguration const& iAllocConfig,
0073                             ProcessContext const*);
0074     std::unique_ptr<Schedule> finishSchedule(MadeModules,
0075                                              ParameterSet& parameterSet,
0076                                              service::TriggerNamesService const& tns,
0077                                              bool hasSubprocesses,
0078                                              PreallocationConfiguration const& iAllocConfig,
0079                                              ProcessContext const*,
0080                                              ProcessBlockHelperBase& processBlockHelper);
0081 
0082     std::shared_ptr<SignallingProductRegistry const> preg() const { return get_underlying_safe(preg_); }
0083     std::shared_ptr<SignallingProductRegistry>& preg() { return get_underlying_safe(preg_); }
0084     std::shared_ptr<BranchIDListHelper const> branchIDListHelper() const {
0085       return get_underlying_safe(branchIDListHelper_);
0086     }
0087     std::shared_ptr<BranchIDListHelper>& branchIDListHelper() { return get_underlying_safe(branchIDListHelper_); }
0088     std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper() const {
0089       return get_underlying_safe(thinnedAssociationsHelper_);
0090     }
0091     std::shared_ptr<ThinnedAssociationsHelper>& thinnedAssociationsHelper() {
0092       return get_underlying_safe(thinnedAssociationsHelper_);
0093     }
0094     std::shared_ptr<SubProcessParentageHelper>& subProcessParentageHelper() {
0095       return get_underlying_safe(subProcessParentageHelper_);
0096     }
0097     std::shared_ptr<ProcessConfiguration const> processConfiguration() const {
0098       return get_underlying_safe(processConfiguration_);
0099     }
0100     std::shared_ptr<ProcessConfiguration>& processConfiguration() { return get_underlying_safe(processConfiguration_); }
0101 
0102     std::shared_ptr<ActivityRegistry> actReg_;  // We do not use propagate_const because the registry itself is mutable.
0103     edm::propagate_const<std::shared_ptr<SignallingProductRegistry>> preg_;
0104     edm::propagate_const<std::shared_ptr<BranchIDListHelper>> branchIDListHelper_;
0105     edm::propagate_const<std::shared_ptr<ThinnedAssociationsHelper>> thinnedAssociationsHelper_;
0106     edm::propagate_const<std::shared_ptr<SubProcessParentageHelper>> subProcessParentageHelper_;
0107     std::unique_ptr<ExceptionToActionTable const> act_table_;
0108     edm::propagate_const<std::shared_ptr<ProcessConfiguration>> processConfiguration_;
0109   };
0110 }  // namespace edm
0111 #endif