CMS 3D CMS Logo

outputmoduleAbilityToImplementor.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_global_outputmoduleAbilityToImplementor_h
2 #define FWCore_Framework_global_outputmoduleAbilityToImplementor_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : outputmodule::AbilityToImplementor
7 //
16 //
17 //
18 
19 // system include files
20 
21 // user include files
25 
26 // forward declarations
27 
28 namespace edm {
29  class FileBlock;
30  class ModuleCallingContext;
31 
32  namespace global {
33  namespace outputmodule {
34 
35  class InputFileWatcher : public virtual OutputModuleBase {
36  public:
38  InputFileWatcher(InputFileWatcher const&) = delete;
41 
42  private:
43  void doRespondToOpenInputFile_(FileBlock const&) final;
44  void doRespondToCloseInputFile_(FileBlock const&) final;
45 
46  virtual void respondToOpenInputFile(FileBlock const&) = 0;
47  virtual void respondToCloseInputFile(FileBlock const&) = 0;
48  };
49 
50  template <typename T, typename C>
51  class RunCacheHolder : public virtual T {
52  public:
54  RunCacheHolder( RunCacheHolder<T,C> const&) = delete;
56  ~RunCacheHolder() noexcept(false) override {};
57  protected:
58  C const* runCache(edm::RunIndex iID) const { return cache_.get(); }
59  private:
60  void doBeginRun_(RunForOutput const& rp) final {
61  cache_ = globalBeginRun(rp);
62  }
63  void doEndRun_(RunForOutput const& rp) final {
64  globalEndRun(rp);
65  cache_ = nullptr; // propagate_const<T> has no reset() function
66  }
67 
68  virtual std::shared_ptr<C> globalBeginRun(RunForOutput const&) const = 0;
69  virtual void globalEndRun(RunForOutput const&) const = 0;
70  //When threaded we will have a container for N items whre N is # of simultaneous runs
72  };
73 
74  template <typename T, typename C>
75  class LuminosityBlockCacheHolder : public virtual T {
76  public:
81  protected:
82  C const* luminosityBlockCache(edm::LuminosityBlockIndex iID) const { return cache_.get(); }
83  private:
85  cache_ = globalBeginLuminosityBlock(rp);
86  }
88  globalEndLuminosityBlock(rp);
89  cache_.reset();
90  }
91 
92  virtual std::shared_ptr<C> globalBeginLuminosityBlock(LuminosityBlockForOutput const&) const = 0;
93  virtual void globalEndLuminosityBlock(LuminosityBlockForOutput const&) const = 0;
94  //When threaded we will have a container for N items whre N is # of simultaneous runs
95  std::shared_ptr<C> cache_;
96  };
97 
98  template<typename T> struct AbilityToImplementor;
99 
100  template<>
103  };
104 
105  template<typename C>
108  };
109 
110  template<typename C>
113  };
114 
115  }
116  }
117 }
118 
119 
120 #endif
virtual void respondToOpenInputFile(FileBlock const &)=0
edm::global::outputmodule::LuminosityBlockCacheHolder< edm::global::OutputModuleBase, C > Type
InputFileWatcher & operator=(InputFileWatcher const &)=delete
edm::global::outputmodule::RunCacheHolder< edm::global::OutputModuleBase, C > Type
#define noexcept
void doEndLuminosityBlock_(LuminosityBlockForOutput const &rp) final
void doBeginLuminosityBlock_(LuminosityBlockForOutput const &rp) final
C const * luminosityBlockCache(edm::LuminosityBlockIndex iID) const
edm::propagate_const< std::shared_ptr< C > > cache_
void doRespondToOpenInputFile_(FileBlock const &) final
void doRespondToCloseInputFile_(FileBlock const &) final
HLT enums.
long double T
virtual void respondToCloseInputFile(FileBlock const &)=0