CMS 3D CMS Logo

implementors.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_one_implementors_h
2 #define FWCore_Framework_one_implementors_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : implementors
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 09 May 2013 18:40:17 GMT
19 //
20 
21 // system include files
22 #include <string>
23 #include <set>
24 
25 // user include files
28 
29 // forward declarations
30 
31 namespace edm {
33 
34  namespace one {
35  namespace impl {
36  template<bool V>
38 
39  template<>
41  edm::SerialTaskQueue* queue() { return &queue_;}
43  };
44 
45  template<>
47  edm::SerialTaskQueue* queue() { return nullptr;}
48  };
49 
50  template<typename T>
51  class SharedResourcesUser : public virtual T {
52  public:
53  template< typename... Args>
54  SharedResourcesUser(Args... args) : T(args...) {}
56  SharedResourcesUser& operator=(SharedResourcesUser const&) = delete;
57 
58  ~SharedResourcesUser() override {}
59 
60  protected:
61 
62  void usesResource(std::string const& iName);
63  void usesResource();
64  private:
65  SharedResourcesAcquirer createAcquirer() override;
66  std::set<std::string> resourceNames_;
67  };
68 
69  template <typename T>
70  class RunWatcher : public virtual T {
71  public:
72  RunWatcher() = default;
73  RunWatcher(RunWatcher const&) = delete;
74  RunWatcher& operator=(RunWatcher const&) = delete;
75  ~RunWatcher() noexcept(false) override {};
76 
77  private:
78  void doBeginRun_(Run const& rp, EventSetup const& c) final;
79  void doEndRun_(Run const& rp, EventSetup const& c) final;
80 
81 
82  virtual void beginRun(edm::Run const&, edm::EventSetup const&) = 0;
83  virtual void endRun(edm::Run const&, edm::EventSetup const&) = 0;
84  };
85 
86  template <typename T>
87  class LuminosityBlockWatcher : public virtual T {
88  public:
89  LuminosityBlockWatcher() = default;
91  LuminosityBlockWatcher& operator=(LuminosityBlockWatcher const&) = delete;
93 
94  private:
95  void doBeginLuminosityBlock_(LuminosityBlock const& rp, EventSetup const& c) final;
96  void doEndLuminosityBlock_(LuminosityBlock const& rp, EventSetup const& c) final;
97 
98  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) = 0;
99  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) = 0;
100  };
101 
102  template <typename T>
103  class BeginRunProducer : public virtual T {
104  public:
105  BeginRunProducer() = default;
106  BeginRunProducer( BeginRunProducer const&) = delete;
107  BeginRunProducer& operator=(BeginRunProducer const&) = delete;
109 
110  private:
111  void doBeginRunProduce_(Run& rp, EventSetup const& c) final;
112 
113  virtual void beginRunProduce(edm::Run&, edm::EventSetup const&) = 0;
114  };
115 
116  template <typename T>
117  class EndRunProducer : public virtual T {
118  public:
119  EndRunProducer() = default;
120  EndRunProducer( EndRunProducer const&) = delete;
121  EndRunProducer& operator=(EndRunProducer const&) = delete;
123 
124  private:
125 
126  void doEndRunProduce_(Run& rp, EventSetup const& c) final;
127 
128  virtual void endRunProduce(edm::Run&, edm::EventSetup const&) = 0;
129  };
130 
131  template <typename T>
132  class BeginLuminosityBlockProducer : public virtual T {
133  public:
134  BeginLuminosityBlockProducer() = default;
138 
139  private:
140  void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c) final;
141 
142  virtual void beginLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) = 0;
143  };
144 
145  template <typename T>
146  class EndLuminosityBlockProducer : public virtual T {
147  public:
148  EndLuminosityBlockProducer() = default;
150  EndLuminosityBlockProducer& operator=(EndLuminosityBlockProducer const&) = delete;
152 
153  private:
154  void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c) final;
155 
156  virtual void endLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) = 0;
157  };
158 
159  template <typename T>
160  class Accumulator : public virtual T {
161  public:
162  Accumulator() = default;
163  Accumulator(Accumulator const&) = delete;
164  Accumulator& operator=(Accumulator const&) = delete;
165  ~Accumulator() noexcept(false) override {};
166 
167  private:
168 
169  bool hasAccumulator() const override { return true; }
170 
171  void produce(Event& ev, EventSetup const& es) final {
172  accumulate(ev, es);
173  }
174 
175  virtual void accumulate(Event const& ev, EventSetup const& es) = 0;
176  };
177  }
178  }
179 }
180 
181 #endif
void produce(Event &ev, EventSetup const &es) final
Definition: implementors.h:171
#define noexcept
bool ev
~Accumulator() noexcept(false) override
Definition: implementors.h:165
bool hasAccumulator() const override
Definition: implementors.h:169
~EndRunProducer() noexcept(false) override
Definition: implementors.h:122
~LuminosityBlockWatcher() noexcept(false) override
Definition: implementors.h:92
~EndLuminosityBlockProducer() noexcept(false) override
Definition: implementors.h:151
std::set< std::string > resourceNames_
Definition: implementors.h:66
~BeginLuminosityBlockProducer() noexcept(false) override
Definition: implementors.h:137
~BeginRunProducer() noexcept(false) override
Definition: implementors.h:108
HLT enums.
~RunWatcher() noexcept(false) override
Definition: implementors.h:75
long double T
Definition: Run.h:44