CMS 3D CMS Logo

EDLooperBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EDLooperBase_h
2 #define FWCore_Framework_EDLooperBase_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Module: EDLooperBase
7 //
51 //
52 // Author: Chris Jones
53 // Created: Mon Aug 9 12:42:17 EDT 2010
54 //
55 
61 
62 #include <set>
63 #include <memory>
64 
65 namespace edm {
66  namespace eventsetup {
67  class EventSetupRecordKey;
68  class EventSetupProvider;
69  } // namespace eventsetup
70  class ExceptionToActionTable;
71  class ProcessContext;
72  class ScheduleInfo;
73  class StreamContext;
74  class ModuleChanger;
76  class ActivityRegistry;
77  class ServiceToken;
78  class WaitingTaskHolder;
79 
80  class EDLooperBase : public EDConsumerBase {
81  public:
82  enum Status { kContinue, kStop };
83 
84  EDLooperBase();
85  ~EDLooperBase() noexcept(false) override;
86 
87  EDLooperBase(EDLooperBase const&) = delete; // Disallow copying and moving
88  EDLooperBase& operator=(EDLooperBase const&) = delete; // Disallow copying and moving
89 
90  void doStartingNewLoop();
93  void prepareForNextLoop(eventsetup::EventSetupProvider* esp);
98 
100  //This interface is deprecated
101  virtual void beginOfJob(EventSetup const&);
102  virtual void beginOfJob();
103 
104  virtual void endOfJob();
105 
106  void prefetchAsync(WaitingTaskHolder iTask,
108  Transition iTrans,
109  Principal const& iPrincipal,
110  EventSetupImpl const& iImpl) const noexcept;
111 
113  EventSetupImpl const& iImpl,
114  Transition iTrans,
115  ServiceToken const& iToken) const noexcept;
116 
118  virtual void attachTo(ActivityRegistry&);
119 
120  void setActionTable(ExceptionToActionTable const* actionTable) { act_table_ = actionTable; }
121 
122  virtual std::set<eventsetup::EventSetupRecordKey> modifyingRecords() const;
123 
124  void copyInfo(ScheduleInfo const&);
126 
127  protected:
131  ScheduleInfo const* scheduleInfo() const;
132 
133  private:
138  virtual void startingNewLoop(unsigned int) = 0;
139 
142  virtual Status duringLoop(Event const&, EventSetup const&, ProcessingController&) = 0;
143 
148  virtual Status endOfLoop(EventSetup const&, unsigned int iCounter) = 0;
149 
151  virtual void beginRun(Run const&, EventSetup const&);
152 
154  virtual void endRun(Run const&, EventSetup const&);
155 
157  virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&);
158 
160  virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&);
161 
163  ServiceToken const& token,
164  Principal const& iPrincipal) const noexcept;
165 
166  unsigned int iCounter_;
168 
171 
174  };
175 } // namespace edm
176 
177 #endif
void prefetchAsync(WaitingTaskHolder iTask, ServiceToken const &token, Transition iTrans, Principal const &iPrincipal, EventSetupImpl const &iImpl) const noexcept
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
void doEndLuminosityBlock(LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:173
unsigned int iCounter_
Definition: EDLooperBase.h:166
Status doEndOfLoop(EventSetupImpl const &es)
Definition: EDLooperBase.cc:79
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the begin of a LuminosityBlock.
virtual std::set< eventsetup::EventSetupRecordKey > modifyingRecords() const
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:172
Status doDuringLoop(EventPrincipal &eventPrincipal, EventSetupImpl const &es, ProcessingController &, StreamContext *)
Definition: EDLooperBase.cc:47
Transition
Definition: Transition.h:12
void esPrefetchAsync(WaitingTaskHolder iTask, EventSetupImpl const &iImpl, Transition iTrans, ServiceToken const &iToken) const noexcept
virtual void endOfJob()
void doBeginRun(RunPrincipal &, EventSetupImpl const &, ProcessContext *)
~EDLooperBase() noexcept(false) override
Definition: EDLooperBase.cc:43
void setModuleChanger(ModuleChanger *)
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:169
void setActionTable(ExceptionToActionTable const *actionTable)
Definition: EDLooperBase.h:120
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:167
void copyInfo(ScheduleInfo const &)
void doBeginLuminosityBlock(LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
virtual void beginOfJob()
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
void prepareForNextLoop(eventsetup::EventSetupProvider *esp)
Definition: EDLooperBase.cc:86
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
virtual void startingNewLoop(unsigned int)=0
HLT enums.
ModuleChanger * moduleChanger()
This only returns a non-zero value during the call to endOfLoop.
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:170
void doEndRun(RunPrincipal &, EventSetupImpl const &, ProcessContext *)
virtual void attachTo(ActivityRegistry &)
Override this method if you need to monitor the state of the processing.
void doStartingNewLoop()
Definition: EDLooperBase.cc:45
Definition: Run.h:45
void edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const &token, Principal const &iPrincipal) const noexcept
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.