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 
217 
220 
223 
226 
229 
232 
235 
238 
241 
242  //preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
243  //postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
244 
245  //preModuleBeginRunSignal_.connect(std::cref(iOther.preModuleBeginRunSignal_));
246  //postModuleBeginRunSignal_.connect(std::cref(iOther.postModuleBeginRunSignal_));
247 
248  //preModuleEndRunSignal_.connect(std::cref(iOther.preModuleEndRunSignal_));
249  //postModuleEndRunSignal_.connect(std::cref(iOther.postModuleEndRunSignal_));
250 
251  //preModuleBeginLumiSignal_.connect(std::cref(iOther.preModuleBeginLumiSignal_));
252  //postModuleBeginLumiSignal_.connect(std::cref(iOther.postModuleBeginLumiSignal_));
253 
254  //preModuleEndLumiSignal_.connect(std::cref(iOther.preModuleEndLumiSignal_));
255  //postModuleEndLumiSignal_.connect(std::cref(iOther.postModuleEndLumiSignal_));
256  }
257 
258  void
260  connectGlobals(iOther);
261  connectLocals(iOther);
262  }
263 
264  void
266  connectGlobals(iOther); // child sees parents global signals
267  iOther.connectLocals(*this); // parent see childs global signals
268  }
269 
270  void
272  copySlotsToFrom(preallocateSignal_,iOther.preallocateSignal_);
273  copySlotsToFrom(preBeginJobSignal_, iOther.preBeginJobSignal_);
274  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
275  copySlotsToFromReverse(preEndJobSignal_, iOther.preEndJobSignal_);
276  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
277 
278  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
279 
280  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
281  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
282 
283  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
284  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
285 
286  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
287  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
288 
289  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
290  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
291 
292  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
293  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
294 
296  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
297 
298  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
299  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
300 
301  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
302  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
303 
304  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
305  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
306 
307  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
308  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
309 
310  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
311  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
312 
313  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
314  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
315 
316  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
317  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
318 
319  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
320  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
321 
322  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
323  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
324 
325  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
326  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
327 
328  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
329  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
330 
334 
335  /*
336  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
337  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
338 
339  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
340  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
341 
342  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
343  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
344 
345  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
346  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
347 
348  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
349  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
350 
351  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
352  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
353 
354  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
355  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
356 
357  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
358  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
359 
360  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
361  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
362 
363  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
364  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
365 */
367  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
368 
369  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
370  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
371 
372  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
373  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
374 
375  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
376  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
377 
380 
383 
385  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
386 
389 
391  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
392 
395 
397  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
398 
401 
403  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
404 
405  /*
406  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
407  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
408 
409  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
410  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
411 
412  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
413  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
414 
415  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
416  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
417 
418  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
419  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
420  */
422  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
423 
426  }
427 
428  //
429  // const member functions
430  //
431 
432  //
433  // static member functions
434  //
435 }
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)
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_
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_
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_