File indexing completed on 2025-06-29 22:58:01
0001 #ifndef FWCore_Framework_one_OutputModuleBase_h
0002 #define FWCore_Framework_one_OutputModuleBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/Framework/interface/OutputModuleCore.h"
0025 #include "FWCore/Framework/interface/SharedResourcesAcquirer.h"
0026
0027
0028 namespace edm {
0029
0030 namespace one {
0031
0032 class OutputModuleBase : public core::OutputModuleCore {
0033 public:
0034 template <typename U>
0035 friend class edm::maker::ModuleHolderT;
0036 template <typename T>
0037 friend class ::edm::WorkerT;
0038 template <typename T>
0039 friend class ::edm::OutputModuleCommunicatorT;
0040 typedef OutputModuleBase ModuleType;
0041
0042 explicit OutputModuleBase(ParameterSet const& pset);
0043
0044 OutputModuleBase(OutputModuleBase const&) = delete;
0045 OutputModuleBase& operator=(OutputModuleBase const&) = delete;
0046
0047
0048 virtual bool wantsProcessBlocks() const noexcept = 0;
0049 virtual bool wantsInputProcessBlocks() const noexcept = 0;
0050 virtual bool wantsGlobalRuns() const noexcept = 0;
0051 virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0;
0052 bool wantsStreamRuns() const noexcept { return false; }
0053 bool wantsStreamLuminosityBlocks() const noexcept { return false; };
0054
0055 virtual SerialTaskQueue* globalRunsQueue() { return nullptr; }
0056 virtual SerialTaskQueue* globalLuminosityBlocksQueue() { return nullptr; }
0057 SharedResourcesAcquirer& sharedResourcesAcquirer() { return resourcesAcquirer_; }
0058
0059 protected:
0060 void doPreallocate(PreallocationConfiguration const&);
0061
0062 void doBeginJob();
0063 bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);
0064
0065 void configure(OutputModuleDescription const& desc);
0066
0067 private:
0068 SharedResourcesAcquirer resourcesAcquirer_;
0069 SerialTaskQueue runQueue_;
0070 SerialTaskQueue luminosityBlockQueue_;
0071
0072 virtual SharedResourcesAcquirer createAcquirer();
0073
0074 virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask,
0075 ModuleCallingContext const& iModuleCallingContext,
0076 Principal const& iPrincipal) const noexcept {}
0077
0078 bool hasAcquire() const noexcept { return false; }
0079 };
0080 }
0081 }
0082 #endif