CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
callAbilities.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_stream_callAbilities_h
2 #define FWCore_Framework_stream_callAbilities_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : callAbilities
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sat, 03 Aug 2013 16:28:35 GMT
19 //
20 
21 // system include files
22 #include <memory>
23 // user include files
25 
26 // forward declarations
27 namespace edm {
28  class Run;
29  class EventSetup;
30  namespace stream {
31  //********************************
32  // CallGlobal
33  //********************************
34  template<typename T , bool>
35  struct CallGlobalImpl {
36  template<typename B>
37  static void set(B* iProd,
38  typename T::GlobalCache const* iCache) {
39  static_cast<T*>(iProd)->setGlobalCache(iCache);
40  }
41  static void endJob(typename T::GlobalCache* iCache) {
42  T::globalEndJob(iCache);
43  }
44  };
45  template<typename T>
47  static void set(void* iProd,
48  void const* iCache) {}
49  static void endJob(void* iCache) {
50  }
51  };
52 
54  //********************************
55  // CallGlobalRun
56  //********************************
57  template<typename T, bool>
59  static void beginRun(edm::Run const& iRun,
60  edm::EventSetup const& iES,
61  typename T::GlobalCache const* iGC,
62  std::shared_ptr<typename T::RunCache const>& oCache) {
63  oCache = T::globalBeginRun(iRun,iES,iGC);
64  }
65 
66  template <typename B>
67  static void set(B* iProd, typename T::RunCache const* iCache) {
68  static_cast<T*>(iProd)->setRunCache(iCache);
69  }
70 
71  static void endRun(edm::Run const& iRun,
72  edm::EventSetup const& iES,
73  typename T::RunContext const* iContext) {
74  T::globalEndRun(iRun, iES, iContext);
75  }
76  };
77 
78  template<typename T>
80  static void beginRun(edm::Run const& ,
81  edm::EventSetup const& ,
82  typename T::GlobalCache const* ,
83  impl::dummy_ptr ) {
84  }
85  static void set(void* iProd,
86  typename T::RunCache const* iCache) {}
87  static void endRun(edm::Run const& ,
88  edm::EventSetup const& ,
89  typename T::RunContext const* ) {
90  }
91  };
92 
94 
95  //********************************
96  // CallGlobalRunSummary
97  //********************************
98  template<typename T, bool>
100  static void beginRun(edm::Run const& iRun,
101  edm::EventSetup const& iES,
102  typename T::RunContext const* iRC,
103  std::shared_ptr<typename T::RunSummaryCache>& oCache) {
104  oCache = T::globalBeginRunSummary(iRun,iES,iRC);
105  }
106  template<typename B>
107  static void streamEndRunSummary(B* iProd,
108  edm::Run const& iRun,
109  edm::EventSetup const& iES,
110  typename T::RunSummaryCache* iCache) {
111  static_cast<T*>(iProd)->endRunSummary(iRun,iES,iCache);
112  }
113 
114  static void globalEndRun(edm::Run const& iRun,
115  edm::EventSetup const& iES,
116  typename T::RunContext const* iContext,
117  typename T::RunSummaryCache* iCache) {
118  T::globalEndRunSummary(iRun, iES, iContext,iCache);
119  }
120  };
121 
122  template<typename T>
124  static void beginRun(edm::Run const& ,
125  edm::EventSetup const& ,
126  typename T::RunContext const* ,
127  impl::dummy_ptr ) {
128  }
129  static void streamEndRunSummary(void* iProd,
130  edm::Run const&,
131  edm::EventSetup const&,
132  typename T::RunSummaryCache const* iCache) {}
133  static void globalEndRun(edm::Run const& ,
134  edm::EventSetup const& ,
135  typename T::RunContext const*,
136  typename T::RunSummaryCache* ) {
137  }
138  };
139 
141 
142  //********************************
143  // CallGlobalLuminosityBlock
144  //********************************
145  template<typename T, bool>
148  edm::EventSetup const& iES,
149  typename T::RunContext const* iRC,
150  std::shared_ptr<typename T::LuminosityBlockCache const>& oCache) {
151  oCache = T::globalBeginLuminosityBlock(Lumi,iES,iRC);
152  }
153 
154  template <typename B>
155  static void set(B* iProd, typename T::LuminosityBlockCache const* iCache) {
156  static_cast<T*>(iProd)->setLuminosityBlockCache(iCache);
157  }
158 
159  static void endLuminosityBlock(edm::LuminosityBlock const& Lumi,
160  edm::EventSetup const& iES,
161  typename T::LuminosityBlockContext const* iContext) {
162  T::globalEndLuminosityBlock(Lumi, iES, iContext);
163  }
164  };
165 
166  template<typename T>
169  edm::EventSetup const& ,
170  typename T::RunContext const* ,
171  impl::dummy_ptr ) {
172  }
173  static void set(void* iProd,
174  typename T::LuminosityBlockCache const* iCache) {}
176  edm::EventSetup const& ,
177  typename T::LuminosityBlockContext const* ) {
178  }
179  };
181 
182  //********************************
183  // CallGlobalLuminosityBlockSummary
184  //********************************
185  template<typename T, bool>
188  edm::EventSetup const& iES,
189  typename T::LuminosityBlockContext const* iRC,
190  std::shared_ptr<typename T::LuminosityBlockSummaryCache>& oCache) {
191  oCache = T::globalBeginLuminosityBlockSummary(Lumi,iES,iRC);
192  }
193  template<typename B>
194  static void streamEndLuminosityBlockSummary(B* iProd,
195  edm::LuminosityBlock const& iLumi,
196  edm::EventSetup const& iES,
197  typename T::LuminosityBlockSummaryCache* iCache) {
198  static_cast<T*>(iProd)->endLuminosityBlockSummary(iLumi,iES,iCache);
199  }
200 
202  edm::EventSetup const& iES,
203  typename T::LuminosityBlockContext const* iContext,
204  typename T::LuminosityBlockSummaryCache* iCache) {
205  T::globalEndLuminosityBlockSummary(Lumi, iES, iContext,iCache);
206  }
207  };
208 
209  template<typename T>
212  edm::EventSetup const& ,
213  typename T::LuminosityBlockContext const* ,
214  impl::dummy_ptr ) {
215  }
216  static void streamEndLuminosityBlockSummary(void* iProd,
217  edm::LuminosityBlock const&,
218  edm::EventSetup const&,
219  typename T::LuminosityBlockSummaryCache* iCache) {}
221  edm::EventSetup const& ,
222  typename T::LuminosityBlockContext const*,
223  typename T::LuminosityBlockSummaryCache* ) {
224  }
225  };
226 
228 
229  //********************************
230  // CallBeginRunProduce
231  //********************************
232  template<typename T, bool >
234  static void produce(edm::Run& iRun,
235  edm::EventSetup const& iES,
236  typename T::RunContext const* iRC) {
237  T::globalBeginRunProduce(iRun,iES,iRC);
238  }
239  };
240 
241  template<typename T>
243  static void produce(edm::Run& iRun,
244  edm::EventSetup const& iES,
245  typename T::RunContext const* iRC) {
246  }
247  };
248 
250 
251  //********************************
252  // CallEndRunProduce
253  //********************************
254  template<typename T, bool bProduce, bool bSummary>
256  static void produce(edm::Run&,
257  edm::EventSetup const&,
258  typename T::RunContext const*,
259  typename T::RunSummaryCache const*) {}
260  };
261 
262  template<typename T>
264  static void produce(edm::Run& iRun,
265  edm::EventSetup const& iES,
266  typename T::RunContext const* iRC,
267  typename T::RunSummaryCache const*) {
268  T::globalEndRunProduce(iRun,iES,iRC);
269  }
270  };
271 
272  template<typename T>
274  static void produce(edm::Run& iRun,
275  edm::EventSetup const& iES,
276  typename T::RunContext const* iRC,
277  typename T::RunSummaryCache const* iRS) {
278  T::globalEndRunProduce(iRun,iES,iRC, iRS);
279  }
280  };
281 
283 
284  //********************************
285  // CallBeginLuminosityBlockProduce
286  //********************************
287  template<typename T, bool >
289  static void produce(edm::LuminosityBlock& Lumi,
290  edm::EventSetup const& iES,
291  typename T::LuminosityBlockContext const* iRC) {
292  T::globalBeginLuminosityBlockProduce(Lumi,iES,iRC);
293  }
294  };
295 
296  template<typename T>
298  static void produce(edm::LuminosityBlock& Lumi,
299  edm::EventSetup const& iES,
300  typename T::LuminosityBlockContext const* iRC) {
301  }
302  };
303 
305 
306  //********************************
307  // CallEndLuminosityBlockProduce
308  //********************************
309  template<typename T, bool bProduce, bool bSummary>
312  edm::EventSetup const&,
313  typename T::LuminosityBlockContext const*,
314  typename T::LuminosityBlockSummaryCache const*) {}
315  };
316 
317  template<typename T>
319  static void produce(edm::LuminosityBlock& Lumi,
320  edm::EventSetup const& iES,
321  typename T::LuminosityBlockContext const* iRC,
322  typename T::LuminosityBlockSummaryCache const*) {
323  T::globalEndLuminosityBlockProduce(Lumi,iES,iRC);
324  }
325  };
326 
327  template<typename T>
329  static void produce(edm::LuminosityBlock& Lumi,
330  edm::EventSetup const& iES,
331  typename T::LuminosityBlockContext const* iRC,
332  typename T::LuminosityBlockSummaryCache const* iRS) {
333  T::globalEndLuminosityBlockProduce(Lumi,iES,iRC, iRS);
334  }
335  };
336 
338 
339  }
340 }
341 
342 
343 #endif
static void endLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iContext)
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC)
static void beginRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, std::shared_ptr< typename T::RunSummaryCache > &oCache)
static void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, typename T::LuminosityBlockSummaryCache *)
static void endRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iContext)
Definition: callAbilities.h:71
static void set(void *iProd, typename T::LuminosityBlockCache const *iCache)
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC)
static void produce(edm::LuminosityBlock &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, typename T::LuminosityBlockSummaryCache const *)
static void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *, impl::dummy_ptr)
static void set(void *iProd, typename T::RunCache const *iCache)
Definition: callAbilities.h:85
static void streamEndRunSummary(B *iProd, edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunSummaryCache *iCache)
static void set(void *iProd, void const *iCache)
Definition: callAbilities.h:47
static void beginRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::GlobalCache const *iGC, std::shared_ptr< typename T::RunCache const > &oCache)
Definition: callAbilities.h:59
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC)
static void set(B *iProd, typename T::RunCache const *iCache)
Definition: callAbilities.h:67
static void beginLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, std::shared_ptr< typename T::LuminosityBlockSummaryCache > &oCache)
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC)
static void globalEndRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *, typename T::RunSummaryCache *)
static void beginRun(edm::Run const &, edm::EventSetup const &, typename T::GlobalCache const *, impl::dummy_ptr)
Definition: callAbilities.h:80
static void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockContext const *)
static void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &, typename T::RunContext const *, impl::dummy_ptr)
static void beginRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *, impl::dummy_ptr)
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, typename T::RunSummaryCache const *iRS)
static void streamEndRunSummary(void *iProd, edm::Run const &, edm::EventSetup const &, typename T::RunSummaryCache const *iCache)
static void set(B *iProd, typename T::LuminosityBlockCache const *iCache)
static void endJob(typename T::GlobalCache *iCache)
Definition: callAbilities.h:41
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, typename T::LuminosityBlockSummaryCache const *iRS)
static void streamEndLuminosityBlockSummary(B *iProd, edm::LuminosityBlock const &iLumi, edm::EventSetup const &iES, typename T::LuminosityBlockSummaryCache *iCache)
static void globalEndRun(edm::Run const &iRun, edm::EventSetup const &iES, typename T::RunContext const *iContext, typename T::RunSummaryCache *iCache)
static void endJob(void *iCache)
Definition: callAbilities.h:49
static void streamEndLuminosityBlockSummary(void *iProd, edm::LuminosityBlock const &, edm::EventSetup const &, typename T::LuminosityBlockSummaryCache *iCache)
static void produce(edm::Run &iRun, edm::EventSetup const &iES, typename T::RunContext const *iRC, typename T::RunSummaryCache const *)
static void produce(edm::Run &, edm::EventSetup const &, typename T::RunContext const *, typename T::RunSummaryCache const *)
volatile std::atomic< bool > shutdown_flag false
static void produce(edm::LuminosityBlock &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iRC, typename T::LuminosityBlockSummaryCache const *)
static void globalEndLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::LuminosityBlockContext const *iContext, typename T::LuminosityBlockSummaryCache *iCache)
long double T
static void beginLuminosityBlock(edm::LuminosityBlock const &Lumi, edm::EventSetup const &iES, typename T::RunContext const *iRC, std::shared_ptr< typename T::LuminosityBlockCache const > &oCache)
static void set(B *iProd, typename T::GlobalCache const *iCache)
Definition: callAbilities.h:37
Definition: Run.h:42
static void endRun(edm::Run const &, edm::EventSetup const &, typename T::RunContext const *)
Definition: callAbilities.h:87