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  class ThinnedAssociationsHelper;
12 
13  namespace one {
14  class OutputModuleBase;
15  }
16  namespace impl {
17  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(void *);
18  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(::edm::OutputModule *);
19  std::unique_ptr<edm::OutputModuleCommunicator> createCommunicatorIfNeeded(::edm::one::OutputModuleBase *);
20  }
21 
22  template <typename T>
23 
24  class OutputModuleCommunicatorT : public edm::OutputModuleCommunicator {
25  public:
27  module_(iModule){}
28  virtual void closeFile() override;
29 
31  virtual bool shouldWeCloseFile() const override;
32 
33  virtual void openNewFileIfNeeded() override;
34 
36  virtual bool wantAllEvents() const override;
37 
38  virtual void openFile(edm::FileBlock const& fb) override;
39 
40  virtual void writeRun(edm::RunPrincipal const& rp, ProcessContext const*) override;
41 
42  virtual void writeLumi(edm::LuminosityBlockPrincipal const& lbp, ProcessContext const*) override;
43 
45  virtual bool limitReached() const override;
46 
47  virtual void configure(edm::OutputModuleDescription const& desc) override;
48 
49  virtual edm::SelectedProductsForBranchType const& keptProducts() const override;
50 
51  virtual void selectProducts(edm::ProductRegistry const& preg, ThinnedAssociationsHelper const&) override;
52 
53  virtual void setEventSelectionInfo(std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
54  bool anyProductProduced) override;
55 
56  virtual ModuleDescription const& description() const override;
57 
58  static std::unique_ptr<edm::OutputModuleCommunicator> createIfNeeded(T* iMod) {
59  return std::move(impl::createCommunicatorIfNeeded(iMod));
60  return std::move(std::unique_ptr<edm::OutputModuleCommunicator>{});
61  }
62 
63  private:
64  inline T& module() const { return *module_;}
66  };
67 }
68 #endif
virtual bool wantAllEvents() const override
virtual edm::SelectedProductsForBranchType const & keptProducts() const override
virtual void selectProducts(edm::ProductRegistry const &preg, ThinnedAssociationsHelper 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
static std::unique_ptr< edm::OutputModuleCommunicator > createIfNeeded(T *iMod)
virtual bool shouldWeCloseFile() const override
preg
Definition: Schedule.cc:370
long double T
virtual void openFile(edm::FileBlock const &fb) override