File indexing completed on 2024-04-06 12:12:06
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 class ModuleTypeResolverMaker;
0030 namespace service {
0031 class TriggerNamesService;
0032 }
0033
0034 struct ScheduleItems {
0035 ScheduleItems();
0036
0037 ScheduleItems(ProductRegistry const& preg,
0038 SubProcess const& om,
0039 SubProcessBlockHelper& subProcessBlockHelper,
0040 ProcessBlockHelperBase const& parentProcessBlockHelper);
0041
0042 ScheduleItems(ScheduleItems const&) = delete;
0043 ScheduleItems& operator=(ScheduleItems const&) = delete;
0044
0045 ServiceToken initServices(std::vector<ParameterSet>& servicePSets,
0046 ParameterSet& processPSet,
0047 ServiceToken const& iToken,
0048 serviceregistry::ServiceLegacy iLegacy,
0049 bool associate);
0050
0051 ServiceToken addCPRandTNS(ParameterSet const& parameterSet, ServiceToken const& token);
0052
0053 std::shared_ptr<CommonParams> initMisc(ParameterSet& parameterSet);
0054
0055 std::unique_ptr<Schedule> initSchedule(ParameterSet& parameterSet,
0056 bool hasSubprocesses,
0057 PreallocationConfiguration const& iAllocConfig,
0058 ProcessContext const*,
0059 ModuleTypeResolverMaker const*,
0060 ProcessBlockHelperBase& processBlockHelper);
0061
0062 class MadeModules {
0063 friend struct ScheduleItems;
0064 explicit MadeModules(std::unique_ptr<Schedule> iSched) : m_schedule(std::move(iSched)) {}
0065
0066 std::unique_ptr<Schedule> m_schedule;
0067
0068 public:
0069 MadeModules() = delete;
0070 };
0071
0072 MadeModules initModules(ParameterSet& parameterSet,
0073 service::TriggerNamesService const& tns,
0074 PreallocationConfiguration const& iAllocConfig,
0075 ProcessContext const*,
0076 ModuleTypeResolverMaker const* typeResolverMaker);
0077 std::unique_ptr<Schedule> finishSchedule(MadeModules,
0078 ParameterSet& parameterSet,
0079 service::TriggerNamesService const& tns,
0080 bool hasSubprocesses,
0081 PreallocationConfiguration const& iAllocConfig,
0082 ProcessContext const*,
0083 ProcessBlockHelperBase& processBlockHelper);
0084
0085 std::shared_ptr<SignallingProductRegistry const> preg() const { return get_underlying_safe(preg_); }
0086 std::shared_ptr<SignallingProductRegistry>& preg() { return get_underlying_safe(preg_); }
0087 std::shared_ptr<BranchIDListHelper const> branchIDListHelper() const {
0088 return get_underlying_safe(branchIDListHelper_);
0089 }
0090 std::shared_ptr<BranchIDListHelper>& branchIDListHelper() { return get_underlying_safe(branchIDListHelper_); }
0091 std::shared_ptr<ThinnedAssociationsHelper const> thinnedAssociationsHelper() const {
0092 return get_underlying_safe(thinnedAssociationsHelper_);
0093 }
0094 std::shared_ptr<ThinnedAssociationsHelper>& thinnedAssociationsHelper() {
0095 return get_underlying_safe(thinnedAssociationsHelper_);
0096 }
0097 std::shared_ptr<SubProcessParentageHelper>& subProcessParentageHelper() {
0098 return get_underlying_safe(subProcessParentageHelper_);
0099 }
0100 std::shared_ptr<ProcessConfiguration const> processConfiguration() const {
0101 return get_underlying_safe(processConfiguration_);
0102 }
0103 std::shared_ptr<ProcessConfiguration>& processConfiguration() { return get_underlying_safe(processConfiguration_); }
0104
0105 std::shared_ptr<ActivityRegistry> actReg_;
0106 edm::propagate_const<std::shared_ptr<SignallingProductRegistry>> preg_;
0107 edm::propagate_const<std::shared_ptr<BranchIDListHelper>> branchIDListHelper_;
0108 edm::propagate_const<std::shared_ptr<ThinnedAssociationsHelper>> thinnedAssociationsHelper_;
0109 edm::propagate_const<std::shared_ptr<SubProcessParentageHelper>> subProcessParentageHelper_;
0110 std::unique_ptr<ExceptionToActionTable const> act_table_;
0111 edm::propagate_const<std::shared_ptr<ProcessConfiguration>> processConfiguration_;
0112 };
0113 }
0114 #endif