OutputWorker.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
8 
9 namespace art {
10 
11  OutputWorker::~OutputWorker() = default;
12 
13  // This is called directly by the make_worker function created
14  // by the DEFINE_ART_MODULE macro.
15  OutputWorker::OutputWorker(std::shared_ptr<OutputModule> mod,
16  ModuleDescription const& md,
17  WorkerParams const& wp)
18  : WorkerT<OutputModule>{mod, md, wp}
19  {
20  ci_->outputModuleInitiated(
21  label(),
22  fhicl::ParameterSetRegistry::get(description().parameterSetID()));
23  }
24 
25  std::string const&
27  {
28  return module().lastClosedFileName();
29  }
30 
31  bool
33  {
34  bool const didCloseFile{module().doCloseFile()};
35  if (didCloseFile) {
36  ci_->outputFileClosed(description().moduleLabel(), lastClosedFileName());
37  }
38  return didCloseFile;
39  }
40 
41  void
43  {
45  }
46 
47  bool
49  {
50  return module().requestsToCloseFile();
51  }
52 
53  bool
55  {
56  bool const didOpenFile{module().doOpenFile(fb)};
57  if (didOpenFile) {
58  ci_->outputFileOpened(description().moduleLabel());
59  }
60  return didOpenFile;
61  }
62 
63  void
65  {
66  module().doWriteRun(rp);
67  }
68 
69  void
71  {
72  module().doWriteSubRun(srp);
73  }
74 
75  void
77  {
78  module().doWriteEvent(ep, mc);
79  }
80 
81  void
83  {
85  }
86 
87  void
89  {
91  }
92 
93  bool
95  {
96  return module().fileIsOpen();
97  }
98 
99  void
101  {
102  return module().setFileStatus(ofs);
103  }
104 
105  bool
107  {
108  return module().limitReached();
109  }
110 
111  void
113  {
114  module().configure(desc);
115  }
116 
117  void
119  {
120  module().selectProducts(tables);
121  }
122 
125  {
126  return module().fileGranularity();
127  }
128 
129 } // namespace art
bool doOpenFile(FileBlock const &fb)
void doWriteEvent(EventPrincipal &ep, ModuleContext const &mc)
void setRunAuxiliaryRangeSetID(RangeSet const &)
Definition: OutputWorker.cc:82
virtual void incrementInputFileNumber()
std::string string
Definition: nybbler.cc:12
static collection_type const & get() noexcept
std::string const & label() const
Definition: Worker.cc:124
std::string const & lastClosedFileName() const
Definition: OutputWorker.cc:26
virtual void selectProducts(ProductTables const &)
void doWriteSubRun(SubRunPrincipal &srp)
void writeEvent(EventPrincipal &ep, ModuleContext const &mc)
Definition: OutputWorker.cc:76
bool limitReached() const
void configure(OutputModuleDescription const &desc)
virtual ~OutputWorker()
virtual std::string const & lastClosedFileName() const
void setFileStatus(OutputFileStatus)
bool fileIsOpen() const
Definition: OutputWorker.cc:94
void selectProducts(ProductTables const &)
bool limitReached() const
OutputFileStatus
void setSubRunAuxiliaryRangeSetID(RangeSet const &)
Definition: OutputWorker.cc:88
bool openFile(FileBlock const &fb)
Definition: OutputWorker.cc:54
void doSetSubRunAuxiliaryRangeSetID(RangeSet const &)
virtual Granularity fileGranularity() const
bool requestsToCloseFile() const
Definition: OutputWorker.cc:48
bool fileIsOpen() const
Definition: OutputModule.cc:88
ModuleDescription const & description() const
Definition: Worker.cc:118
OutputWorker(std::shared_ptr< OutputModule > mod, ModuleDescription const &, WorkerParams const &)
Definition: OutputWorker.cc:15
virtual bool requestsToCloseFile() const
OutputModule & module()
Definition: WorkerT.h:33
void doWriteRun(RunPrincipal &rp)
virtual void setFileStatus(OutputFileStatus)
void incrementInputFileNumber()
Definition: OutputWorker.cc:42
void writeSubRun(SubRunPrincipal &srp)
Definition: OutputWorker.cc:70
ServiceHandle< CatalogInterface > ci_
Definition: OutputWorker.h:53
void doSetRunAuxiliaryRangeSetID(RangeSet const &)
void configure(OutputModuleDescription const &desc)
void writeRun(RunPrincipal &rp)
Definition: OutputWorker.cc:64
Granularity fileGranularity() const