CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ActivityRegistry.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ServiceRegistry
4 // Class : ActivityRegistry
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Tue Sep 6 10:26:49 EDT 2005
11 //
12 
13 // system include files
14 #include <algorithm>
15 
16 // user include files
19 
20 //
21 // constants, enums and typedefs
22 //
23 
24 //
25 // static data member definitions
26 //
27 
28 //
29 // constructors and destructor
30 //
31 //ActivityRegistry::ActivityRegistry() {
32 //}
33 
34 // ActivityRegistry::ActivityRegistry(ActivityRegistry const& rhs) {
35 // // do actual copying here;
36 // }
37 
38 //ActivityRegistry::~ActivityRegistry() {
39 //}
40 
41 //
42 // assignment operators
43 //
44 // ActivityRegistry const& ActivityRegistry::operator=(ActivityRegistry const& rhs) {
45 // //An exception safe implementation is
46 // ActivityRegistry temp(rhs);
47 // swap(rhs);
48 //
49 // return *this;
50 // }
51 
52 //
53 // member functions
54 //
55 namespace edm {
56  namespace {
57  template<typename T>
58  inline
59  void
60  copySlotsToFrom(T& iTo, T& iFrom) {
61  for(auto& slot: iFrom.slots()) {
62  iTo.connect(slot);
63  }
64  }
65 
66  template<typename T>
67  inline
68  void
69  copySlotsToFromReverse(T& iTo, T& iFrom) {
70  // This handles service slots that are supposed to be in reverse
71  // order of construction. Copying new ones in is a little
72  // tricky. Here is an example of what follows
73  // slots in iTo before 4 3 2 1 and copy in slots in iFrom 8 7 6 5.
74  // reverse iFrom 5 6 7 8
75  // then do the copy to front 8 7 6 5 4 3 2 1
76 
77  auto slotsFrom = iFrom.slots();
78 
79  std::reverse(slotsFrom.begin(), slotsFrom.end());
80 
81  for(auto& slotFrom: slotsFrom) {
82  iTo.connect_front(slotFrom);
83  }
84  }
85  }
86 
87  void
91  postEndJobSignal_.connect(std::cref(iOther.postEndJobSignal_));
92 
93  jobFailureSignal_.connect(std::cref(iOther.jobFailureSignal_));
94 
95  preSourceSignal_.connect(std::cref(iOther.preSourceSignal_));
96  postSourceSignal_.connect(std::cref(iOther.postSourceSignal_));
97 
100 
103 
104  preOpenFileSignal_.connect(std::cref(iOther.preOpenFileSignal_));
106 
109 
112 
115  }
116 
117  void
119 
122 
125 
128 
131 
134 
137 
140 
143 
146 
149 
150  preEventSignal_.connect(std::cref(iOther.preEventSignal_));
151  postEventSignal_.connect(std::cref(iOther.postEventSignal_));
152 
155 
158 
159  preBeginRunSignal_.connect(std::cref(iOther.preBeginRunSignal_));
161 
162  preEndRunSignal_.connect(std::cref(iOther.preEndRunSignal_));
163  postEndRunSignal_.connect(std::cref(iOther.postEndRunSignal_));
164 
167 
168  preEndLumiSignal_.connect(std::cref(iOther.preEndLumiSignal_));
169  postEndLumiSignal_.connect(std::cref(iOther.postEndLumiSignal_));
170 
173 
176 
179 
182 
185 
188 
191 
194 
197 
200 
201 
204 
207 
210 
213 
216 
219 
222 
225 
226  preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
227  postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
228 
231 
234 
237 
240  }
241 
242  void
244  connectGlobals(iOther);
245  connectLocals(iOther);
246  }
247 
248  void
250  connectGlobals(iOther); // child sees parents global signals
251  iOther.connectLocals(*this); // parent see childs global signals
252  }
253 
254  void
256  copySlotsToFrom(preallocateSignal_,iOther.preallocateSignal_);
257  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
258  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
259 
260  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
261 
262  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
263  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
264 
265  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
266  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
267 
268  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
269  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
270 
271  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
272  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
273 
274  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
275  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
276 
278  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
279 
280  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
281  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
282 
283  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
284  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
285 
286  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
287  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
288 
289  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
290  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
291 
292  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
293  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
294 
295  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
296  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
297 
298  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
299  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
300 
301  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
302  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
303 
304  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
305  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
306 
307  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
308  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
309 
310  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
311  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
312 
313  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
314  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
315 
316  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
317  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
318 
319  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
320  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
321 
322  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
323  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
324 
325  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
326  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
327 
328  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
329  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
330 
331  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
332  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
333 
334  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
335  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
336 
337  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
338  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
339 
340  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
341  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
342 
344  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
345 
346  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
347  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
348 
349  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
350  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
351 
352  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
353  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
354 
357 
360 
362  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
363 
366 
368  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
369 
372 
374  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
375 
378 
380  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
381 
382  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
383  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
384 
385  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
386  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
387 
388  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
389  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
390 
391  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
392  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
393 
394  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
395  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
396 
398  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
399 
402  }
403 
404  //
405  // const member functions
406  //
407 
408  //
409  // static member functions
410  //
411 }
PreModuleStreamBeginRun preModuleStreamBeginRunSignal_
PostSourceLumi postSourceLumiSignal_
void connectLocals(ActivityRegistry &iOther)
PreStreamBeginRun preStreamBeginRunSignal_
PreModuleBeginLumi preModuleBeginLumiSignal_
PreBeginLumi preBeginLumiSignal_
signal is emitted after the Lumi has been created by the InputSource but before any modules have seen...
PostModuleEventDelayedGet postModuleEventDelayedGetSignal_
PostModuleStreamEndRun postModuleStreamEndRunSignal_
PreModuleEventDelayedGet preModuleEventDelayedGetSignal_
PreEndRun preEndRunSignal_
signal is emitted before the endRun is processed
PrePathEvent prePathEventSignal_
PostModuleGlobalBeginRun postModuleGlobalBeginRunSignal_
PostModuleBeginStream postModuleBeginStreamSignal_
PreGlobalBeginRun preGlobalBeginRunSignal_
signal is emitted after the Run has been created by the InputSource but before any modules have seen ...
PreSourceRun preSourceRunSignal_
PostModuleEvent postModuleEventSignal_
PostOpenFile postOpenFileSignal_
PreGlobalEndRun preGlobalEndRunSignal_
PostEvent postEventSignal_
signal is emitted after all modules have finished processing the Event
PreModuleEndRun preModuleEndRunSignal_
PostStreamEndLumi postStreamEndLumiSignal_
PostModuleEndRun postModuleEndRunSignal_
PostModuleEndLumi postModuleEndLumiSignal_
PostGlobalBeginRun postGlobalBeginRunSignal_
void connectGlobals(ActivityRegistry &iOther)
PreModuleBeginStream preModuleBeginStreamSignal_
void copySlotsFrom(ActivityRegistry &iOther)
PreEndLumi preEndLumiSignal_
signal is emitted before the endLumi is processed
PostModuleStreamBeginLumi postModuleStreamBeginLumiSignal_
PostSourceRun postSourceRunSignal_
PostSourceConstruction postSourceConstructionSignal_
PostBeginRun postBeginRunSignal_
signal is emitted after all modules have finished processing the beginRun
PreSourceConstruction preSourceConstructionSignal_
PostPathEndRun postPathEndRunSignal_
PostPathBeginRun postPathBeginRunSignal_
PreForkReleaseResources preForkReleaseResourcesSignal_
PreModuleStreamEndLumi preModuleStreamEndLumiSignal_
PostGlobalEndLumi postGlobalEndLumiSignal_
Preallocate preallocateSignal_
signal is emitted before beginJob
PreGlobalBeginLumi preGlobalBeginLumiSignal_
PreModuleBeginRun preModuleBeginRunSignal_
PostForkReacquireResources postForkReacquireResourcesSignal_
PrePathBeginLumi prePathBeginLumiSignal_
PrePathEndRun prePathEndRunSignal_
PostModuleGlobalEndRun postModuleGlobalEndRunSignal_
PostModuleGlobalEndLumi postModuleGlobalEndLumiSignal_
PreModuleStreamEndRun preModuleStreamEndRunSignal_
PostPathEndLumi postPathEndLumiSignal_
PostProcessEvent postProcessEventSignal_
signal is emitted after all modules have finished processing the Event
PostStreamEndRun postStreamEndRunSignal_
PreStreamEndRun preStreamEndRunSignal_
PreModuleConstruction preModuleConstructionSignal_
PostModuleEndStream postModuleEndStreamSignal_
PostEndRun postEndRunSignal_
signal is emitted after all modules have finished processing the Run
PreGlobalEndLumi preGlobalEndLumiSignal_
PostSourceEvent postSourceSignal_
PreCloseFile preCloseFileSignal_
PostModuleBeginLumi postModuleBeginLumiSignal_
PostEndLumi postEndLumiSignal_
signal is emitted after all modules have finished processing the Lumi
PreStreamBeginLumi preStreamBeginLumiSignal_
PreModuleStreamBeginLumi preModuleStreamBeginLumiSignal_
PostStreamBeginRun postStreamBeginRunSignal_
PreModuleGlobalBeginRun preModuleGlobalBeginRunSignal_
PostCloseFile postCloseFileSignal_
PostModuleEndJob postModuleEndJobSignal_
PostModuleBeginJob postModuleBeginJobSignal_
PreModuleGlobalBeginLumi preModuleGlobalBeginLumiSignal_
void connectToSubProcess(ActivityRegistry &iOther)
PreSourceLumi preSourceLumiSignal_
PostModuleBeginRun postModuleBeginRunSignal_
PrePathEndLumi prePathEndLumiSignal_
PreModuleGlobalEndLumi preModuleGlobalEndLumiSignal_
PreProcessPath preProcessPathSignal_
PostGlobalEndRun postGlobalEndRunSignal_
PreProcessEvent preProcessEventSignal_
signal is emitted after the Event has been created by the InputSource but before any modules have see...
PreModuleEvent preModuleEventSignal_
PostGlobalBeginLumi postGlobalBeginLumiSignal_
PreOpenFile preOpenFileSignal_
PreModuleEndLumi preModuleEndLumiSignal_
PostEndJob postEndJobSignal_
signal is emitted after all modules have gotten their endJob called
PreModuleBeginJob preModuleBeginJobSignal_
PreSourceEvent preSourceSignal_
PreModuleEndStream preModuleEndStreamSignal_
PostPathEvent postPathEventSignal_
PostStreamBeginLumi postStreamBeginLumiSignal_
PreStreamEndLumi preStreamEndLumiSignal_
PostModuleStreamEndLumi postModuleStreamEndLumiSignal_
PreModuleGlobalEndRun preModuleGlobalEndRunSignal_
PreEvent preEventSignal_
signal is emitted after the Event has been created by the InputSource but before any modules have see...
PostModuleStreamBeginRun postModuleStreamBeginRunSignal_
long double T
PostBeginJob postBeginJobSignal_
signal is emitted after all modules have gotten their beginJob called
PreModuleEndJob preModuleEndJobSignal_
PrePathBeginRun prePathBeginRunSignal_
void connect(U iFunc)
Definition: Signal.h:63
PostPathBeginLumi postPathBeginLumiSignal_
PostModuleGlobalBeginLumi postModuleGlobalBeginLumiSignal_
PostProcessPath postProcessPathSignal_
PreBeginRun preBeginRunSignal_
signal is emitted after the Run has been created by the InputSource but before any modules have seen ...
PostBeginLumi postBeginLumiSignal_
signal is emitted after all modules have finished processing the beginLumi
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther
PostModuleConstruction postModuleConstructionSignal_