Schedule.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
10 #include "hep_concurrency/WaitingTask.h"
11 
12 #include <ios>
13 
14 using namespace hep::concurrency;
15 using namespace std;
16 
18 
19 namespace art {
20 
21  Schedule::Schedule(ScheduleID const scheduleID,
22  PathManager& pm,
23  ActionTable const& actions,
24  ActivityRegistry const& actReg,
25  UpdateOutputCallbacks& outputCallbacks,
26  std::unique_ptr<Worker> triggerResultsInserter,
27  GlobalTaskGroup& task_group)
28  : context_{scheduleID}
29  , actions_{actions}
30  , actReg_{actReg}
31  , epExec_{scheduleID, pm, actions, actReg_, outputCallbacks, task_group}
32  , tpsExec_{scheduleID,
33  pm,
34  actions,
35  move(triggerResultsInserter),
36  task_group}
37  {
38  TDEBUG_FUNC_SI(5, scheduleID) << hex << this << dec;
39  }
40 
41  void
43  {
44  tpsExec_.beginJob(resources);
45  epExec_.beginJob(resources);
46  }
47 
48  void
50  {
51  tpsExec_.endJob();
52  epExec_.endJob();
53  }
54 
55  void
57  {
60  }
61 
62  void
64  {
67  }
68 
69  void
71  {
74  }
75 
76  void
78  {
81  }
82 
83  void
84  Schedule::process(Transition const trans, Principal& principal)
85  {
86  tpsExec_.process(trans, principal);
87  epExec_.process(trans, principal);
88  }
89 
90  void
91  Schedule::process_event_modifiers(WaitingTaskPtr endPathTask)
92  {
93  // We get here as part of the readAndProcessEvent task.
96  tpsExec_.process_event(endPathTask, *eventPrincipal_);
97  }
98 
99  void
100  Schedule::process_event_observers(WaitingTaskPtr finalizeEventTask)
101  {
102  epExec_.process_event(finalizeEventTask, *eventPrincipal_);
103  }
104 
105 } // namespace art
void endJob()
Definition: Schedule.cc:49
void process_event_observers(hep::concurrency::WaitingTaskPtr finalizeEventTask)
Definition: Schedule.cc:100
void respondToCloseOutputFiles(FileBlock const &)
Definition: Schedule.cc:77
void respondToCloseInputFile(FileBlock const &)
Definition: Schedule.cc:63
EndPathExecutor epExec_
Definition: Schedule.h:204
ActivityRegistry const & actReg_
Definition: Schedule.h:203
void process(Transition, Principal &)
void process(Transition, Principal &)
Definition: Schedule.cc:84
void beginJob(detail::SharedResources const &resources)
Definition: Schedule.cc:42
STL namespace.
QTextStream & hex(QTextStream &s)
void respondToOpenInputFile(FileBlock const &fb)
void respondToOpenOutputFiles(FileBlock const &)
ScheduleContext const context_
Definition: Schedule.h:198
void respondToOpenOutputFiles(FileBlock const &fb)
std::unique_ptr< EventPrincipal > eventPrincipal_
Definition: Schedule.h:206
TriggerPathsExecutor tpsExec_
Definition: Schedule.h:205
void respondToCloseOutputFiles(FileBlock const &fb)
Transition
Definition: Transition.h:7
void respondToOpenInputFile(FileBlock const &)
def move(depos, offset)
Definition: depos.py:107
#define TDEBUG_FUNC_SI(LEVEL, SI)
GlobalSignal< detail::SignalResponseType::FIFO, void(Event const &, ScheduleContext)> sPreProcessEvent
void beginJob(detail::SharedResources const &resources)
QTextStream & dec(QTextStream &s)
void respondToOpenOutputFiles(FileBlock const &)
Definition: Schedule.cc:70
void respondToCloseInputFile(FileBlock const &)
ActionTable const & actions_
Definition: Schedule.h:202
void respondToCloseInputFile(FileBlock const &fb)
void process_event(hep::concurrency::WaitingTaskPtr endPathTask, EventPrincipal &)
void process(Transition, Principal &)
Namespace containing all the test actions.
void process_event_modifiers(hep::concurrency::WaitingTaskPtr endPathTask)
Definition: Schedule.cc:91
void respondToOpenInputFile(FileBlock const &)
Definition: Schedule.cc:56
void respondToCloseOutputFiles(FileBlock const &)
void process_event(hep::concurrency::WaitingTaskPtr finalizeEventTask, EventPrincipal &)
static ModuleContext invalid()
Definition: ModuleContext.h:22
void beginJob(detail::SharedResources const &resources)