CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OutputModuleCommunicatorT.h
Go to the documentation of this file.
1 
2 #ifndef FWCore_Framework_OutputModuleCommunicatorT_h
3 #define FWCore_Framework_OutputModuleCommunicatorT_h
4 /*----------------------------------------------------------------------
5 ----------------------------------------------------------------------*/
6 
8 
9 namespace edm {
10  class OutputModule;
11 
12  namespace one {
13  class OutputModuleBase;
14  }
15  namespace impl {
16  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(void *);
17  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(::edm::OutputModule *);
18  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(::edm::one::OutputModuleBase *);
19  }
20 
21  template <typename T>
22 
23  class OutputModuleCommunicatorT : public edm::OutputModuleCommunicator {
24  public:
26  module_(iModule){}
27  virtual void closeFile() override;
28 
30  virtual bool shouldWeCloseFile() const override;
31 
32  virtual void openNewFileIfNeeded() override;
33 
35  virtual bool wantAllEvents() const override;
36 
37  virtual void openFile(edm::FileBlock const& fb) override;
38 
39  virtual void writeRun(edm::RunPrincipal const& rp, ProcessContext const*) override;
40 
41  virtual void writeLumi(edm::LuminosityBlockPrincipal const& lbp, ProcessContext const*) override;
42 
44  virtual bool limitReached() const override;
45 
46  virtual void configure(edm::OutputModuleDescription const& desc) override;
47 
48  virtual edm::SelectedProductsForBranchType const& keptProducts() const override;
49 
50  virtual void selectProducts(edm::ProductRegistry const& preg) override;
51 
52  virtual void setEventSelectionInfo(std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
53  bool anyProductProduced) override;
54 
55  virtual ModuleDescription const& description() const override;
56 
57  static std::unique_ptr<edm::OutputModuleCommunicator> createIfNeeded(T* iMod) {
58  return std::move(impl::createCommunicatorIfNeeded(iMod));
59  return std::move(std::unique_ptr<edm::OutputModuleCommunicator>{});
60  }
61 
62  private:
63  inline T& module() const { return *module_;}
65  };
66 }
67 #endif
virtual bool wantAllEvents() const override
virtual edm::SelectedProductsForBranchType const & keptProducts() const override
virtual void configure(edm::OutputModuleDescription const &desc) override
virtual void writeRun(edm::RunPrincipal const &rp, ProcessContext const *) override
virtual void openNewFileIfNeeded() override
virtual bool limitReached() const override
virtual void writeLumi(edm::LuminosityBlockPrincipal const &lbp, ProcessContext const *) override
std::unique_ptr< edm::OutputModuleCommunicator > createCommunicatorIfNeeded(void *)
virtual void setEventSelectionInfo(std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced) override
boost::array< SelectedProducts, NumBranchTypes > SelectedProductsForBranchType
virtual ModuleDescription const & description() const override
virtual void selectProducts(edm::ProductRegistry const &preg) override
static std::unique_ptr< edm::OutputModuleCommunicator > createIfNeeded(T *iMod)
virtual bool shouldWeCloseFile() const override
preg
Definition: Schedule.cc:368
long double T
virtual void openFile(edm::FileBlock const &fb) override