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
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
32 //ActivityRegistry::ActivityRegistry() {
33 //}
34 
35 // ActivityRegistry::ActivityRegistry(ActivityRegistry const& rhs) {
36 // // do actual copying here;
37 // }
38 
39 //ActivityRegistry::~ActivityRegistry() {
40 //}
41 
42 //
43 // assignment operators
44 //
45 // ActivityRegistry const& ActivityRegistry::operator=(ActivityRegistry const& rhs) {
46 // //An exception safe implementation is
47 // ActivityRegistry temp(rhs);
48 // swap(rhs);
49 //
50 // return *this;
51 // }
52 
53 //
54 // member functions
55 //
56 namespace edm {
57  namespace {
58  template<typename T>
59  inline
60  void
61  copySlotsToFrom(T& iTo, T& iFrom) {
62  for(auto& slot: iFrom.slots()) {
63  iTo.connect(slot);
64  }
65  }
66 
67  template<typename T>
68  inline
69  void
70  copySlotsToFromReverse(T& iTo, T& iFrom) {
71  // This handles service slots that are supposed to be in reverse
72  // order of construction. Copying new ones in is a little
73  // tricky. Here is an example of what follows
74  // slots in iTo before 4 3 2 1 and copy in slots in iFrom 8 7 6 5.
75  // reverse iFrom 5 6 7 8
76  // then do the copy to front 8 7 6 5 4 3 2 1
77 
78  auto slotsFrom = iFrom.slots();
79 
80  std::reverse(slotsFrom.begin(), slotsFrom.end());
81 
82  for(auto& slotFrom: slotsFrom) {
83  iTo.connect_front(slotFrom);
84  }
85  }
86  }
87 
88  namespace signalslot {
90  throw cms::Exception("ConnectedToObsoleteServiceSignal")
91  <<"A Service has connected to an obsolete ActivityRegistry signal.";
92  }
93  }
94 
95  void
99  preEndJobSignal_.connect(std::cref(iOther.preEndJobSignal_));
100  postEndJobSignal_.connect(std::cref(iOther.postEndJobSignal_));
101 
102  jobFailureSignal_.connect(std::cref(iOther.jobFailureSignal_));
103 
104  preSourceSignal_.connect(std::cref(iOther.preSourceSignal_));
105  postSourceSignal_.connect(std::cref(iOther.postSourceSignal_));
106 
109 
112 
113  preOpenFileSignal_.connect(std::cref(iOther.preOpenFileSignal_));
115 
118 
121 
124 
128 
129  }
130 
131  void
133 
134  preBeginJobSignal_.connect(std::cref(iOther.preBeginJobSignal_));
135 
138 
141 
144 
147 
150 
153 
156 
159 
162 
165 
166  preEventSignal_.connect(std::cref(iOther.preEventSignal_));
167  postEventSignal_.connect(std::cref(iOther.postEventSignal_));
168 
171 
172  //preProcessEventSignal_.connect(std::cref(iOther.preProcessEventSignal_));
173  //postProcessEventSignal_.connect(std::cref(iOther.postProcessEventSignal_));
174 
175  //preBeginRunSignal_.connect(std::cref(iOther.preBeginRunSignal_));
176  //postBeginRunSignal_.connect(std::cref(iOther.postBeginRunSignal_));
177 
178  //preEndRunSignal_.connect(std::cref(iOther.preEndRunSignal_));
179  //postEndRunSignal_.connect(std::cref(iOther.postEndRunSignal_));
180 
181  //preBeginLumiSignal_.connect(std::cref(iOther.preBeginLumiSignal_));
182  //postBeginLumiSignal_.connect(std::cref(iOther.postBeginLumiSignal_));
183 
184  //preEndLumiSignal_.connect(std::cref(iOther.preEndLumiSignal_));
185  //postEndLumiSignal_.connect(std::cref(iOther.postEndLumiSignal_));
186 
187  //preProcessPathSignal_.connect(std::cref(iOther.preProcessPathSignal_));
188  //postProcessPathSignal_.connect(std::cref(iOther.postProcessPathSignal_));
189 
190  //prePathBeginRunSignal_.connect(std::cref(iOther.prePathBeginRunSignal_));
191  //postPathBeginRunSignal_.connect(std::cref(iOther.postPathBeginRunSignal_));
192 
193  //prePathEndRunSignal_.connect(std::cref(iOther.prePathEndRunSignal_));
194  //postPathEndRunSignal_.connect(std::cref(iOther.postPathEndRunSignal_));
195 
196  //prePathBeginLumiSignal_.connect(std::cref(iOther.prePathBeginLumiSignal_));
197  //postPathBeginLumiSignal_.connect(std::cref(iOther.postPathBeginLumiSignal_));
198 
199  //prePathEndLumiSignal_.connect(std::cref(iOther.prePathEndLumiSignal_));
200  //postPathEndLumiSignal_.connect(std::cref(iOther.postPathEndLumiSignal_));
201 
204 
207 
210 
213 
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
247  //preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
248  //postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
249 
250  //preModuleBeginRunSignal_.connect(std::cref(iOther.preModuleBeginRunSignal_));
251  //postModuleBeginRunSignal_.connect(std::cref(iOther.postModuleBeginRunSignal_));
252 
253  //preModuleEndRunSignal_.connect(std::cref(iOther.preModuleEndRunSignal_));
254  //postModuleEndRunSignal_.connect(std::cref(iOther.postModuleEndRunSignal_));
255 
256  //preModuleBeginLumiSignal_.connect(std::cref(iOther.preModuleBeginLumiSignal_));
257  //postModuleBeginLumiSignal_.connect(std::cref(iOther.postModuleBeginLumiSignal_));
258 
259  //preModuleEndLumiSignal_.connect(std::cref(iOther.preModuleEndLumiSignal_));
260  //postModuleEndLumiSignal_.connect(std::cref(iOther.postModuleEndLumiSignal_));
261  }
262 
263  void
265  connectGlobals(iOther);
266  connectLocals(iOther);
267  }
268 
269  void
271  connectGlobals(iOther); // child sees parents global signals
272  iOther.connectLocals(*this); // parent see childs global signals
273  }
274 
275  void
277  copySlotsToFrom(preallocateSignal_,iOther.preallocateSignal_);
278  copySlotsToFrom(preBeginJobSignal_, iOther.preBeginJobSignal_);
279  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
280  copySlotsToFromReverse(preEndJobSignal_, iOther.preEndJobSignal_);
281  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
282 
283  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
284 
285  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
286  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
287 
288  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
289  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
290 
291  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
292  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
293 
294  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
295  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
296 
297  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
298  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
299 
301  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
302 
303  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
304  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
305 
306  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
307  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
308 
309  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
310  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
311 
312  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
313  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
314 
315  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
316  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
317 
318  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
319  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
320 
321  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
322  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
323 
324  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
325  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
326 
327  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
328  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
329 
330  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
331  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
332 
333  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
334  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
335 
339 
340  /*
341  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
342  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
343 
344  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
345  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
346 
347  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
348  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
349 
350  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
351  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
352 
353  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
354  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
355 
356  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
357  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
358 
359  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
360  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
361 
362  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
363  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
364 
365  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
366  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
367 
368  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
369  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
370 */
372  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
373 
374  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
375  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
376 
377  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
378  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
379 
382 
383  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
384  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
385 
388 
390  copySlotsToFromReverse(postEventReadFromSourceSignal_, iOther.postEventReadFromSourceSignal_);
391 
394 
396  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
397 
400 
402  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
403 
406 
408  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
409 
412 
414  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
415 
416  /*
417  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
418  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
419 
420  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
421  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
422 
423  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
424  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
425 
426  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
427  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
428 
429  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
430  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
431  */
433  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
434 
437  }
438 
439  //
440  // const member functions
441  //
442 
443  //
444  // static member functions
445  //
446 }
PreModuleEventPrefetching preModuleEventPrefetchingSignal_
PreModuleStreamBeginRun preModuleStreamBeginRunSignal_
PostSourceLumi postSourceLumiSignal_
void connectLocals(ActivityRegistry &iOther)
PreStreamBeginRun preStreamBeginRunSignal_
PostModuleEventDelayedGet postModuleEventDelayedGetSignal_
PostModuleStreamEndRun postModuleStreamEndRunSignal_
PreModuleEventDelayedGet preModuleEventDelayedGetSignal_
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_
void throwObsoleteSignalException()
PostOpenFile postOpenFileSignal_
PreGlobalEndRun preGlobalEndRunSignal_
PostEvent postEventSignal_
signal is emitted after all modules have finished processing the Event
PostStreamEndLumi postStreamEndLumiSignal_
PostGlobalBeginRun postGlobalBeginRunSignal_
void connectGlobals(ActivityRegistry &iOther)
PreModuleBeginStream preModuleBeginStreamSignal_
void copySlotsFrom(ActivityRegistry &iOther)
PostModuleEventPrefetching postModuleEventPrefetchingSignal_
PostModuleStreamBeginLumi postModuleStreamBeginLumiSignal_
PostSourceRun postSourceRunSignal_
PostSourceConstruction postSourceConstructionSignal_
PreSourceConstruction preSourceConstructionSignal_
PreForkReleaseResources preForkReleaseResourcesSignal_
PreModuleStreamEndLumi preModuleStreamEndLumiSignal_
PostGlobalEndLumi postGlobalEndLumiSignal_
Preallocate preallocateSignal_
signal is emitted before beginJob
PreGlobalBeginLumi preGlobalBeginLumiSignal_
PostForkReacquireResources postForkReacquireResourcesSignal_
PreStreamEarlyTermination preStreamEarlyTerminationSignal_
PreSourceEarlyTermination preSourceEarlyTerminationSignal_
PostModuleGlobalEndRun postModuleGlobalEndRunSignal_
PostModuleGlobalEndLumi postModuleGlobalEndLumiSignal_
PreModuleStreamEndRun preModuleStreamEndRunSignal_
PostStreamEndRun postStreamEndRunSignal_
PreStreamEndRun preStreamEndRunSignal_
PreModuleConstruction preModuleConstructionSignal_
PostModuleEndStream postModuleEndStreamSignal_
PreGlobalEndLumi preGlobalEndLumiSignal_
PreEventReadFromSource preEventReadFromSourceSignal_
PostSourceEvent postSourceSignal_
PreCloseFile preCloseFileSignal_
PreGlobalEarlyTermination preGlobalEarlyTerminationSignal_
PreStreamBeginLumi preStreamBeginLumiSignal_
PreModuleStreamBeginLumi preModuleStreamBeginLumiSignal_
PostStreamBeginRun postStreamBeginRunSignal_
PreModuleGlobalBeginRun preModuleGlobalBeginRunSignal_
PostCloseFile postCloseFileSignal_
PostModuleEndJob postModuleEndJobSignal_
PostModuleBeginJob postModuleBeginJobSignal_
PreModuleGlobalBeginLumi preModuleGlobalBeginLumiSignal_
void connectToSubProcess(ActivityRegistry &iOther)
PreSourceLumi preSourceLumiSignal_
PreModuleGlobalEndLumi preModuleGlobalEndLumiSignal_
PostGlobalEndRun postGlobalEndRunSignal_
PreModuleEvent preModuleEventSignal_
PostGlobalBeginLumi postGlobalBeginLumiSignal_
PreOpenFile preOpenFileSignal_
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_
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_
void connect(U iFunc)
Definition: Signal.h:63
PostModuleGlobalBeginLumi postModuleGlobalBeginLumiSignal_
PostEventReadFromSource postEventReadFromSourceSignal_
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther
PreEndJob preEndJobSignal_
signal is emitted before any modules have gotten their endJob called
PostModuleConstruction postModuleConstructionSignal_