ReplicatedProducer.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_ReplicatedProducer_h
2 #define art_Framework_Core_ReplicatedProducer_h
3 // vim: set sw=2 expandtab :
4 
11 
12 #include <string>
13 
14 namespace art {
15  namespace detail {
16  class SharedResources;
17  }
18 
20  private detail::EngineCreator {
21  public:
24 
25  // Only the TriggerResults module is allowed to have no
26  // module_label parameter. We provide a default empty string for
27  // only that reason.
29  ProcessingFrame const& frame)
30  : detail::Producer{pset}
31  , detail::EngineCreator{pset.get<std::string>("module_label", {}),
32  frame.scheduleID()}
33  {}
34 
35  template <typename Config>
37  ProcessingFrame const& frame)
38  : ReplicatedProducer{config.get_PSet(), frame}
39  {}
40 
42 
43  std::string workerType() const;
44 
45  private:
46  void setupQueues(detail::SharedResources const&) override final;
47  void beginJobWithFrame(ProcessingFrame const&) override final;
48  void endJobWithFrame(ProcessingFrame const&) override final;
49  void respondToOpenInputFileWithFrame(FileBlock const&,
50  ProcessingFrame const&) override final;
51  void respondToCloseInputFileWithFrame(
52  FileBlock const&,
53  ProcessingFrame const&) override final;
54  void respondToOpenOutputFilesWithFrame(
55  FileBlock const&,
56  ProcessingFrame const&) override final;
57  void respondToCloseOutputFilesWithFrame(
58  FileBlock const&,
59  ProcessingFrame const&) override final;
60  void beginRunWithFrame(Run&, ProcessingFrame const&) override final;
61  void endRunWithFrame(Run&, ProcessingFrame const&) override final;
62  void beginSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
63  void endSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
64  void produceWithFrame(Event&, ProcessingFrame const&) override final;
65 
66  virtual void beginJob(ProcessingFrame const&);
67  virtual void endJob(ProcessingFrame const&);
68  virtual void respondToOpenInputFile(FileBlock const&,
69  ProcessingFrame const&);
70  virtual void respondToCloseInputFile(FileBlock const&,
71  ProcessingFrame const&);
72  virtual void respondToOpenOutputFiles(FileBlock const&,
73  ProcessingFrame const&);
74  virtual void respondToCloseOutputFiles(FileBlock const&,
75  ProcessingFrame const&);
76  virtual void beginRun(Run const&, ProcessingFrame const&);
77  virtual void endRun(Run const&, ProcessingFrame const&);
78  virtual void beginSubRun(SubRun const&, ProcessingFrame const&);
79  virtual void endSubRun(SubRun const&, ProcessingFrame const&);
80  virtual void produce(Event&, ProcessingFrame const&) = 0;
81  };
82 
83 } // namespace art
84 
85 #endif /* art_Framework_Core_ReplicatedProducer_h */
86 
87 // Local Variables:
88 // mode: c++
89 // End:
base_engine_t & createEngine(seed_t seed)
std::string string
Definition: nybbler.cc:12
Definition: Run.h:17
ReplicatedProducer(fhicl::ParameterSet const &pset, ProcessingFrame const &frame)
void beginJob()
Definition: Breakpoints.cc:14
static Config * config
Definition: config.cpp:1054
ReplicatedProducer(Table< Config > const &config, ProcessingFrame const &frame)
auto const & get_PSet() const
Definition: ProducerTable.h:47