CMS 3D CMS Logo

OutputModuleBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_limited_OutputModuleBase_h
2 #define FWCore_Framework_limited_OutputModuleBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : OutputModuleBase
7 //
16 //
17 //
18 
19 // system include files
20 
21 // user include files
24 
25 // forward declarations
26 namespace edm {
27 
28  namespace limited {
29 
31  public:
32  template <typename U>
34  template <typename T>
35  friend class ::edm::WorkerT;
36  template <typename T>
37  friend class ::edm::OutputModuleCommunicatorT;
39 
40  explicit OutputModuleBase(ParameterSet const& pset);
41 
42  OutputModuleBase(OutputModuleBase const&) = delete; // Disallow copying and moving
43  OutputModuleBase& operator=(OutputModuleBase const&) = delete; // Disallow copying and moving
44 
45  static void fillDescription(
47  std::vector<std::string> const& iDefaultOutputCommands = ProductSelectorRules::defaultSelectionStrings());
48 
49  //Output modules always need writeRun and writeLumi to be called
50  bool wantsGlobalRuns() const noexcept { return true; }
51  bool wantsGlobalLuminosityBlocks() const noexcept { return true; }
52  virtual bool wantsProcessBlocks() const noexcept = 0;
53  virtual bool wantsInputProcessBlocks() const noexcept = 0;
54  virtual bool wantsStreamRuns() const noexcept = 0;
55  virtual bool wantsStreamLuminosityBlocks() const noexcept = 0;
56 
57  unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); }
58 
59  LimitedTaskQueue& queue() { return queue_; }
60 
61  protected:
63 
64  void doBeginJob();
65 
66  void doBeginStream(StreamID id);
67  void doEndStream(StreamID id);
68 
70  //For now this is a placeholder
72  ModuleCallingContext const&,
73  Principal const&) const noexcept {}
74 
75  private:
77 
78  std::string workerType() const { return "WorkerT<edm::limited::OutputModuleBase>"; }
79 
80  virtual void preallocStreams(unsigned int) {}
81  virtual void preallocate(PreallocationConfiguration const&) {}
82  virtual void doBeginStream_(StreamID) {}
83  virtual void doEndStream_(StreamID) {}
84  virtual void doStreamBeginRun_(StreamID, RunForOutput const&, EventSetup const&) {}
85  virtual void doStreamEndRun_(StreamID, RunForOutput const&, EventSetup const&) {}
86  virtual void doStreamEndRunSummary_(StreamID, RunForOutput const&, EventSetup const&) {}
90 
91  virtual void doBeginRunSummary_(RunForOutput const&, EventSetup const&) {}
92  virtual void doEndRunSummary_(RunForOutput const&, EventSetup const&) {}
95  bool hasAcquire() const noexcept { return false; }
96  };
97  } // namespace limited
98 } // namespace edm
99 #endif
virtual void doStreamBeginRun_(StreamID, RunForOutput const &, EventSetup const &)
virtual void doBeginRunSummary_(RunForOutput const &, EventSetup const &)
virtual void doEndRunSummary_(RunForOutput const &, EventSetup const &)
OutputModuleBase & operator=(OutputModuleBase const &)=delete
static const std::vector< std::string > & defaultSelectionStrings()
void doPreallocate(PreallocationConfiguration const &)
bool wantsGlobalLuminosityBlocks() const noexcept
bool wantsGlobalRuns() const noexcept
virtual void doEndStream_(StreamID)
OutputModuleBase(ParameterSet const &pset)
virtual void doBeginStream_(StreamID)
unsigned int concurrencyLimit() const
void doEndStream(StreamID id)
void doBeginStream(StreamID id)
virtual void preallocate(PreallocationConfiguration const &)
bool hasAcquire() const noexcept
virtual void doBeginLuminosityBlockSummary_(LuminosityBlockForOutput const &, EventSetup const &)
virtual void doStreamEndRunSummary_(StreamID, RunForOutput const &, EventSetup const &)
virtual void doStreamEndLuminosityBlock_(StreamID, LuminosityBlockForOutput const &, EventSetup const &)
std::string workerType() const
virtual bool wantsProcessBlocks() const noexcept=0
virtual void preallocStreams(unsigned int)
virtual void doStreamEndLuminosityBlockSummary_(StreamID, LuminosityBlockForOutput const &, EventSetup const &)
unsigned int concurrencyLimit() const
virtual bool wantsInputProcessBlocks() const noexcept=0
virtual void doStreamEndRun_(StreamID, RunForOutput const &, EventSetup const &)
virtual void doStreamBeginLuminosityBlock_(StreamID, LuminosityBlockForOutput const &, EventSetup const &)
HLT enums.
virtual bool wantsStreamLuminosityBlocks() const noexcept=0
virtual void doEndLuminosityBlockSummary_(LuminosityBlockForOutput const &, EventSetup const &)
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const noexcept
virtual bool wantsStreamRuns() const noexcept=0
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)