CMS 3D CMS Logo

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
20 
21 namespace edm {
22  namespace {
23  template <typename T>
24  inline void copySlotsToFrom(T& iTo, T& iFrom) {
25  for (auto& slot : iFrom.slots()) {
26  iTo.connect(slot);
27  }
28  }
29 
30  template <typename T>
31  inline void copySlotsToFromReverse(T& iTo, T& iFrom) {
32  // This handles service slots that are supposed to be in reverse
33  // order of construction. Copying new ones in is a little
34  // tricky. Here is an example of what follows
35  // slots in iTo before 4 3 2 1 and copy in slots in iFrom 8 7 6 5.
36  // reverse iFrom 5 6 7 8
37  // then do the copy to front 8 7 6 5 4 3 2 1
38 
39  auto slotsFrom = iFrom.slots();
40 
41  std::reverse(slotsFrom.begin(), slotsFrom.end());
42 
43  for (auto& slotFrom : slotsFrom) {
44  iTo.connect_front(slotFrom);
45  }
46  }
47  } // namespace
48 
49  namespace signalslot {
51  throw cms::Exception("ConnectedToObsoleteServiceSignal")
52  << "A Service has connected to an obsolete ActivityRegistry signal.";
53  }
54  } // namespace signalslot
55 
62  preEndJobSignal_.connect(std::cref(iOther.preEndJobSignal_));
63  postEndJobSignal_.connect(std::cref(iOther.postEndJobSignal_));
64 
65  jobFailureSignal_.connect(std::cref(iOther.jobFailureSignal_));
66 
67  preSourceSignal_.connect(std::cref(iOther.preSourceSignal_));
68  postSourceSignal_.connect(std::cref(iOther.postSourceSignal_));
69 
72 
75 
78 
81 
84 
87 
90 
94 
98  }
99 
101  preBeginJobSignal_.connect(std::cref(iOther.preBeginJobSignal_));
102 
105 
108 
111 
114 
117 
120 
123 
126 
129 
132 
135 
138 
141 
144 
147 
150 
153 
156 
157  preEventSignal_.connect(std::cref(iOther.preEventSignal_));
158  postEventSignal_.connect(std::cref(iOther.postEventSignal_));
159 
162 
165 
168 
171 
174 
177 
180 
183 
186 
189 
192 
195 
198 
201 
204 
207 
210 
213 
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
249 
252 
253  preESModuleSignal_.connect(std::cref(iOther.preESModuleSignal_));
255 
258 
260  }
261 
263  connectGlobals(iOther);
264  connectLocals(iOther);
265  }
266 
268  connectGlobals(iOther); // child sees parents global signals
269  iOther.connectLocals(*this); // parent see childs global signals
270  }
271 
273  copySlotsToFrom(preallocateSignal_, iOther.preallocateSignal_);
275  copySlotsToFrom(beginProcessingSignal_, iOther.beginProcessingSignal_);
276  copySlotsToFrom(endProcessingSignal_, iOther.endProcessingSignal_);
277  copySlotsToFrom(preBeginJobSignal_, iOther.preBeginJobSignal_);
278  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
279  copySlotsToFromReverse(preEndJobSignal_, iOther.preEndJobSignal_);
280  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
281 
282  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
283 
284  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
285  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
286 
289 
290  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
291  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
292 
293  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
294  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
295 
297  copySlotsToFromReverse(postSourceProcessBlockSignal_, iOther.postSourceProcessBlockSignal_);
298 
299  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
300  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
301 
302  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
303  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
304 
305  copySlotsToFrom(preBeginStreamSignal_, iOther.preBeginStreamSignal_);
306  copySlotsToFromReverse(postBeginStreamSignal_, iOther.postBeginStreamSignal_);
307 
308  copySlotsToFrom(preEndStreamSignal_, iOther.preEndStreamSignal_);
309  copySlotsToFromReverse(postEndStreamSignal_, iOther.postEndStreamSignal_);
310 
312  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
313 
314  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
315  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
316 
318  copySlotsToFromReverse(postBeginProcessBlockSignal_, iOther.postBeginProcessBlockSignal_);
319 
322 
323  copySlotsToFrom(preEndProcessBlockSignal_, iOther.preEndProcessBlockSignal_);
324  copySlotsToFromReverse(postEndProcessBlockSignal_, iOther.postEndProcessBlockSignal_);
325 
326  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
327  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
328 
329  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
330  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
331 
333  copySlotsToFromReverse(postWriteProcessBlockSignal_, iOther.postWriteProcessBlockSignal_);
334 
335  copySlotsToFrom(preGlobalWriteRunSignal_, iOther.preGlobalWriteRunSignal_);
336  copySlotsToFromReverse(postGlobalWriteRunSignal_, iOther.postGlobalWriteRunSignal_);
337 
338  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
339  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
340 
341  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
342  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
343 
344  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
345  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
346 
347  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
348  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
349 
350  copySlotsToFrom(preGlobalWriteLumiSignal_, iOther.preGlobalWriteLumiSignal_);
351  copySlotsToFromReverse(postGlobalWriteLumiSignal_, iOther.postGlobalWriteLumiSignal_);
352 
353  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
354  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
355 
356  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
357  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
358 
359  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
360  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
361 
362  copySlotsToFrom(preClearEventSignal_, iOther.preClearEventSignal_);
363  copySlotsToFromReverse(postClearEventSignal_, iOther.postClearEventSignal_);
364 
365  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
366  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
367 
371 
373  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
374 
376  copySlotsToFromReverse(postModuleDestructionSignal_, iOther.postModuleDestructionSignal_);
377 
378  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
379  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
380 
381  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
382  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
383 
386 
389 
392 
393  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
394  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
395 
397  copySlotsToFromReverse(postModuleEventAcquireSignal_, iOther.postModuleEventAcquireSignal_);
398 
401 
402  copySlotsToFrom(preModuleTransformSignal_, iOther.preModuleTransformSignal_);
403  copySlotsToFromReverse(postModuleTransformSignal_, iOther.postModuleTransformSignal_);
404 
407 
410 
412  copySlotsToFromReverse(postEventReadFromSourceSignal_, iOther.postEventReadFromSourceSignal_);
413 
416 
418  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
419 
422 
424  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
425 
428 
431 
434 
437 
439  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
440 
443 
445  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
446 
449 
450  copySlotsToFrom(preModuleWriteRunSignal_, iOther.preModuleWriteRunSignal_);
451  copySlotsToFromReverse(postModuleWriteRunSignal_, iOther.postModuleWriteRunSignal_);
452 
453  copySlotsToFrom(preModuleWriteLumiSignal_, iOther.preModuleWriteLumiSignal_);
454  copySlotsToFromReverse(postModuleWriteLumiSignal_, iOther.postModuleWriteLumiSignal_);
455 
457  copySlotsToFromReverse(postESModulePrefetchingSignal_, iOther.postESModulePrefetchingSignal_);
458 
459  copySlotsToFrom(preESModuleSignal_, iOther.preESModuleSignal_);
460  copySlotsToFromReverse(postESModuleSignal_, iOther.postESModuleSignal_);
461 
462  copySlotsToFrom(preESModuleAcquireSignal_, iOther.preESModuleAcquireSignal_);
463  copySlotsToFromReverse(postESModuleAcquireSignal_, iOther.postESModuleAcquireSignal_);
464 
466 
468  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
469 
470  copySlotsToFrom(esSyncIOVQueuingSignal_, iOther.esSyncIOVQueuingSignal_);
471  copySlotsToFrom(preESSyncIOVSignal_, iOther.preESSyncIOVSignal_);
472  copySlotsToFromReverse(postESSyncIOVSignal_, iOther.postESSyncIOVSignal_);
473  }
474 } // namespace edm
PreClearEvent preClearEventSignal_
signal is emitted before the data products in the Event are cleared
PreModuleEventPrefetching preModuleEventPrefetchingSignal_
PreModuleStreamBeginRun preModuleStreamBeginRunSignal_
PostEndProcessBlock postEndProcessBlockSignal_
PostSourceLumi postSourceLumiSignal_
PreStreamBeginRun preStreamBeginRunSignal_
PostBeginStream postBeginStreamSignal_
void connectLocals(ActivityRegistry &iOther)
PostModuleEventDelayedGet postModuleEventDelayedGetSignal_
PostModuleStreamEndRun postModuleStreamEndRunSignal_
PostModuleDestruction postModuleDestructionSignal_
PreModuleEventDelayedGet preModuleEventDelayedGetSignal_
PrePathEvent prePathEventSignal_
PostBeginProcessBlock postBeginProcessBlockSignal_
PostModuleGlobalBeginRun postModuleGlobalBeginRunSignal_
PostModuleBeginStream postModuleBeginStreamSignal_
PreGlobalBeginRun preGlobalBeginRunSignal_
signal is emitted after the Run has been created by the InputSource but before any modules have seen ...
PostModuleGlobalPrefetching postModuleGlobalPrefetchingSignal_
PostModuleWriteProcessBlock postModuleWriteProcessBlockSignal_
PreModuleWriteLumi preModuleWriteLumiSignal_
PreSourceRun preSourceRunSignal_
EventSetupConfiguration eventSetupConfigurationSignal_
signal is emitted before beginJob
PostModuleEvent postModuleEventSignal_
PreEndStream preEndStreamSignal_
void throwObsoleteSignalException()
PreESSyncIOV preESSyncIOVSignal_
PreESModulePrefetching preESModulePrefetchingSignal_
PostOpenFile postOpenFileSignal_
PreGlobalEndRun preGlobalEndRunSignal_
PostSourceProcessBlock postSourceProcessBlockSignal_
PostEvent postEventSignal_
signal is emitted after all modules have finished processing the Event
PostStreamEndLumi postStreamEndLumiSignal_
PostGlobalBeginRun postGlobalBeginRunSignal_
PostModuleWriteLumi postModuleWriteLumiSignal_
PreModuleGlobalPrefetching preModuleGlobalPrefetchingSignal_
PostModuleAccessInputProcessBlock postModuleAccessInputProcessBlockSignal_
PreAccessInputProcessBlock preAccessInputProcessBlockSignal_
PreModuleBeginStream preModuleBeginStreamSignal_
PostAccessInputProcessBlock postAccessInputProcessBlockSignal_
PostModuleStreamPrefetching postModuleStreamPrefetchingSignal_
PostModuleEventPrefetching postModuleEventPrefetchingSignal_
PostModuleStreamBeginLumi postModuleStreamBeginLumiSignal_
void connectGlobals(ActivityRegistry &iOther)
PreModuleStreamPrefetching preModuleStreamPrefetchingSignal_
PostSourceRun postSourceRunSignal_
PostGlobalEndLumi postGlobalWriteLumiSignal_
PostSourceConstruction postSourceConstructionSignal_
PreModuleTransformPrefetching preModuleTransformPrefetchingSignal_
PreSourceConstruction preSourceConstructionSignal_
PreModuleDestruction preModuleDestructionSignal_
PreESModuleAcquire preESModuleAcquireSignal_
PostModuleEventAcquire postModuleEventAcquireSignal_
PreEndProcessBlock preEndProcessBlockSignal_
PostModuleEndProcessBlock postModuleEndProcessBlockSignal_
PostESModulePrefetching postESModulePrefetchingSignal_
PreModuleStreamEndLumi preModuleStreamEndLumiSignal_
PostGlobalEndLumi postGlobalEndLumiSignal_
Preallocate preallocateSignal_
signal is emitted before beginJob
PreGlobalBeginLumi preGlobalBeginLumiSignal_
PostEndStream postEndStreamSignal_
PreStreamEarlyTermination preStreamEarlyTerminationSignal_
PreSourceEarlyTermination preSourceEarlyTerminationSignal_
PostModuleGlobalEndRun postModuleGlobalEndRunSignal_
PostModuleGlobalEndLumi postModuleGlobalEndLumiSignal_
PreModuleTransform preModuleTransformSignal_
void connectToSubProcess(ActivityRegistry &iOther)
PreModuleStreamEndRun preModuleStreamEndRunSignal_
PostStreamEndRun postStreamEndRunSignal_
PreStreamEndRun preStreamEndRunSignal_
PostGlobalWriteRun postGlobalWriteRunSignal_
PreModuleConstruction preModuleConstructionSignal_
PostModuleEndStream postModuleEndStreamSignal_
PreModuleBeginProcessBlock preModuleBeginProcessBlockSignal_
PreModuleEndProcessBlock preModuleEndProcessBlockSignal_
PreGlobalEndLumi preGlobalEndLumiSignal_
PreEventReadFromSource preEventReadFromSourceSignal_
void copySlotsFrom(ActivityRegistry &iOther)
PreSourceProcessBlock preSourceProcessBlockSignal_
PostSourceEvent postSourceSignal_
PreSourceNextTransition preSourceNextTransitionSignal_
PreModuleTransformAcquiring preModuleTransformAcquiringSignal_
PreCloseFile preCloseFileSignal_
PostModuleWriteRun postModuleWriteRunSignal_
PreGlobalWriteRun preGlobalWriteRunSignal_
PostESModule postESModuleSignal_
PreGlobalEarlyTermination preGlobalEarlyTerminationSignal_
PostESSyncIOV postESSyncIOVSignal_
PreStreamBeginLumi preStreamBeginLumiSignal_
PreModuleStreamBeginLumi preModuleStreamBeginLumiSignal_
PostStreamBeginRun postStreamBeginRunSignal_
ESSyncIOVQueuing esSyncIOVQueuingSignal_
PreModuleGlobalBeginRun preModuleGlobalBeginRunSignal_
PreWriteProcessBlock preWriteProcessBlockSignal_
PostCloseFile postCloseFileSignal_
PostSourceNextTransition postSourceNextTransitionSignal_
PostModuleEndJob postModuleEndJobSignal_
PostModuleBeginJob postModuleBeginJobSignal_
PreModuleGlobalBeginLumi preModuleGlobalBeginLumiSignal_
PreModuleWriteRun preModuleWriteRunSignal_
PreSourceLumi preSourceLumiSignal_
PostWriteProcessBlock postWriteProcessBlockSignal_
PreModuleGlobalEndLumi preModuleGlobalEndLumiSignal_
PostGlobalEndRun postGlobalEndRunSignal_
PreBeginStream preBeginStreamSignal_
PreESModule preESModuleSignal_
PreGlobalEndLumi preGlobalWriteLumiSignal_
PreModuleEvent preModuleEventSignal_
PostModuleTransformPrefetching postModuleTransformPrefetchingSignal_
PostESModuleAcquire postESModuleAcquireSignal_
PostGlobalBeginLumi postGlobalBeginLumiSignal_
EndProcessing endProcessingSignal_
signal is emitted after all work has been done processing all source transitions
PreModuleWriteProcessBlock preModuleWriteProcessBlockSignal_
PreOpenFile preOpenFileSignal_
HLT enums.
PostEndJob postEndJobSignal_
signal is emitted after all modules have gotten their endJob called
PreModuleBeginJob preModuleBeginJobSignal_
PreSourceEvent preSourceSignal_
PreBeginJob preBeginJobSignal_
signal is emitted before all modules have gotten their beginJob called
PreModuleEndStream preModuleEndStreamSignal_
PostPathEvent postPathEventSignal_
PostStreamBeginLumi postStreamBeginLumiSignal_
PreStreamEndLumi preStreamEndLumiSignal_
BeginProcessing beginProcessingSignal_
signal is emitted just before the transitions from the Source will begin to be processed ...
PostModuleStreamEndLumi postModuleStreamEndLumiSignal_
PostModuleTransform postModuleTransformSignal_
PreBeginProcessBlock preBeginProcessBlockSignal_
PreModuleGlobalEndRun preModuleGlobalEndRunSignal_
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther
PreEvent preEventSignal_
signal is emitted after the Event has been created by the InputSource but before any modules have see...
PostModuleStreamBeginRun postModuleStreamBeginRunSignal_
PreModuleEventAcquire preModuleEventAcquireSignal_
PostClearEvent postClearEventSignal_
signal is emitted after all data products in the Event have been cleared
long double T
PostBeginJob postBeginJobSignal_
signal is emitted after all modules have gotten their beginJob called
PreModuleEndJob preModuleEndJobSignal_
PreModuleAccessInputProcessBlock preModuleAccessInputProcessBlockSignal_
PostModuleBeginProcessBlock postModuleBeginProcessBlockSignal_
PostModuleTransformAcquiring postModuleTransformAcquiringSignal_
void connect(U iFunc)
Definition: Signal.h:74
PostESModuleRegistration postESModuleRegistrationSignal_
PostModuleGlobalBeginLumi postModuleGlobalBeginLumiSignal_
PostEventReadFromSource postEventReadFromSourceSignal_
PreEndJob preEndJobSignal_
signal is emitted before any modules have gotten their endJob called
PostModuleConstruction postModuleConstructionSignal_