Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-11 03:34:13

0001 #ifndef FWCore_Framework_OutputModuleCommunicator_h
0002 #define FWCore_Framework_OutputModuleCommunicator_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     OutputModuleCommunicator
0007 //
0008 /**\class edm::OutputModuleCommunicator OutputModuleCommunicator.h "FWCore/Framework/interface/OutputModuleCommunicator.h"
0009 
0010  Description: Base class used by the framework to communicate with an OutputModule
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri, 05 Jul 2013 17:36:51 GMT
0019 //
0020 
0021 // system include files
0022 #include <map>
0023 #include <string>
0024 #include <vector>
0025 
0026 // user include files
0027 #include "DataFormats/Provenance/interface/SelectedProducts.h"
0028 #include "FWCore/Common/interface/FWCoreCommonFwd.h"
0029 #include "FWCore/Framework/interface/Frameworkfwd.h"
0030 
0031 // forward declarations
0032 namespace edm {
0033 
0034   class ActivityRegistry;
0035   class MergeableRunProductMetadata;
0036   class ProcessContext;
0037   class ThinnedAssociationsHelper;
0038   class WaitingTaskHolder;
0039 
0040   class OutputModuleCommunicator {
0041   public:
0042     OutputModuleCommunicator() = default;
0043     OutputModuleCommunicator(const OutputModuleCommunicator&) = delete;
0044     OutputModuleCommunicator& operator=(const OutputModuleCommunicator&) = delete;
0045     virtual ~OutputModuleCommunicator();
0046 
0047     virtual void closeFile() = 0;
0048 
0049     ///\return true if output module wishes to close its file
0050     virtual bool shouldWeCloseFile() const = 0;
0051 
0052     ///\return true if no event filtering is applied to OutputModule
0053     virtual bool wantAllEvents() const = 0;
0054 
0055     virtual void openFile(FileBlock const& fb) = 0;
0056 
0057     virtual void writeProcessBlockAsync(WaitingTaskHolder iTask,
0058                                         ProcessBlockPrincipal const&,
0059                                         ProcessContext const*,
0060                                         ActivityRegistry*) noexcept = 0;
0061 
0062     virtual void writeRunAsync(WaitingTaskHolder iTask,
0063                                RunPrincipal const&,
0064                                ProcessContext const*,
0065                                ActivityRegistry*,
0066                                MergeableRunProductMetadata const*) noexcept = 0;
0067 
0068     virtual void writeLumiAsync(WaitingTaskHolder iTask,
0069                                 LuminosityBlockPrincipal const&,
0070                                 ProcessContext const*,
0071                                 ActivityRegistry*) noexcept = 0;
0072 
0073     ///\return true if OutputModule has reached its limit on maximum number of events it wants to see
0074     virtual bool limitReached() const = 0;
0075 
0076     virtual void configure(OutputModuleDescription const& desc) = 0;
0077 
0078     virtual SelectedProductsForBranchType const& keptProducts() const = 0;
0079 
0080     virtual void selectProducts(ProductRegistry const& preg,
0081                                 ThinnedAssociationsHelper const&,
0082                                 ProcessBlockHelperBase const&) = 0;
0083 
0084     virtual void setEventSelectionInfo(
0085         std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
0086         bool anyProductProduced) = 0;
0087 
0088     virtual ModuleDescription const& description() const = 0;
0089 
0090   private:
0091     // ---------- member data --------------------------------
0092   };
0093 }  // namespace edm
0094 
0095 #endif