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  postEndJobSignal_.connect(std::cref(iOther.postEndJobSignal_));
100 
101  jobFailureSignal_.connect(std::cref(iOther.jobFailureSignal_));
102 
103  preSourceSignal_.connect(std::cref(iOther.preSourceSignal_));
104  postSourceSignal_.connect(std::cref(iOther.postSourceSignal_));
105 
108 
111 
112  preOpenFileSignal_.connect(std::cref(iOther.preOpenFileSignal_));
114 
117 
120 
123 
127 
128  }
129 
130  void
132 
135 
138 
141 
144 
147 
150 
153 
156 
159 
162 
163  preEventSignal_.connect(std::cref(iOther.preEventSignal_));
164  postEventSignal_.connect(std::cref(iOther.postEventSignal_));
165 
168 
169  //preProcessEventSignal_.connect(std::cref(iOther.preProcessEventSignal_));
170  //postProcessEventSignal_.connect(std::cref(iOther.postProcessEventSignal_));
171 
172  //preBeginRunSignal_.connect(std::cref(iOther.preBeginRunSignal_));
173  //postBeginRunSignal_.connect(std::cref(iOther.postBeginRunSignal_));
174 
175  //preEndRunSignal_.connect(std::cref(iOther.preEndRunSignal_));
176  //postEndRunSignal_.connect(std::cref(iOther.postEndRunSignal_));
177 
178  //preBeginLumiSignal_.connect(std::cref(iOther.preBeginLumiSignal_));
179  //postBeginLumiSignal_.connect(std::cref(iOther.postBeginLumiSignal_));
180 
181  //preEndLumiSignal_.connect(std::cref(iOther.preEndLumiSignal_));
182  //postEndLumiSignal_.connect(std::cref(iOther.postEndLumiSignal_));
183 
184  //preProcessPathSignal_.connect(std::cref(iOther.preProcessPathSignal_));
185  //postProcessPathSignal_.connect(std::cref(iOther.postProcessPathSignal_));
186 
187  //prePathBeginRunSignal_.connect(std::cref(iOther.prePathBeginRunSignal_));
188  //postPathBeginRunSignal_.connect(std::cref(iOther.postPathBeginRunSignal_));
189 
190  //prePathEndRunSignal_.connect(std::cref(iOther.prePathEndRunSignal_));
191  //postPathEndRunSignal_.connect(std::cref(iOther.postPathEndRunSignal_));
192 
193  //prePathBeginLumiSignal_.connect(std::cref(iOther.prePathBeginLumiSignal_));
194  //postPathBeginLumiSignal_.connect(std::cref(iOther.postPathBeginLumiSignal_));
195 
196  //prePathEndLumiSignal_.connect(std::cref(iOther.prePathEndLumiSignal_));
197  //postPathEndLumiSignal_.connect(std::cref(iOther.postPathEndLumiSignal_));
198 
201 
204 
207 
210 
213 
214 
217 
220 
223 
226 
229 
232 
235 
238 
239  //preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
240  //postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
241 
242  //preModuleBeginRunSignal_.connect(std::cref(iOther.preModuleBeginRunSignal_));
243  //postModuleBeginRunSignal_.connect(std::cref(iOther.postModuleBeginRunSignal_));
244 
245  //preModuleEndRunSignal_.connect(std::cref(iOther.preModuleEndRunSignal_));
246  //postModuleEndRunSignal_.connect(std::cref(iOther.postModuleEndRunSignal_));
247 
248  //preModuleBeginLumiSignal_.connect(std::cref(iOther.preModuleBeginLumiSignal_));
249  //postModuleBeginLumiSignal_.connect(std::cref(iOther.postModuleBeginLumiSignal_));
250 
251  //preModuleEndLumiSignal_.connect(std::cref(iOther.preModuleEndLumiSignal_));
252  //postModuleEndLumiSignal_.connect(std::cref(iOther.postModuleEndLumiSignal_));
253  }
254 
255  void
257  connectGlobals(iOther);
258  connectLocals(iOther);
259  }
260 
261  void
263  connectGlobals(iOther); // child sees parents global signals
264  iOther.connectLocals(*this); // parent see childs global signals
265  }
266 
267  void
269  copySlotsToFrom(preallocateSignal_,iOther.preallocateSignal_);
270  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
271  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
272 
273  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
274 
275  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
276  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
277 
278  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
279  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
280 
281  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
282  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
283 
284  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
285  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
286 
287  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
288  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
289 
291  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
292 
293  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
294  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
295 
296  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
297  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
298 
299  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
300  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
301 
302  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
303  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
304 
305  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
306  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
307 
308  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
309  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
310 
311  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
312  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
313 
314  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
315  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
316 
317  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
318  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
319 
320  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
321  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
322 
323  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
324  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
325 
329 
330  /*
331  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
332  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
333 
334  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
335  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
336 
337  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
338  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
339 
340  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
341  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
342 
343  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
344  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
345 
346  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
347  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
348 
349  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
350  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
351 
352  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
353  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
354 
355  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
356  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
357 
358  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
359  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
360 */
362  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
363 
364  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
365  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
366 
367  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
368  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
369 
370  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
371  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
372 
375 
378 
380  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
381 
384 
386  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
387 
390 
392  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
393 
396 
398  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
399 
400  /*
401  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
402  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
403 
404  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
405  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
406 
407  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
408  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
409 
410  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
411  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
412 
413  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
414  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
415  */
417  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
418 
421  }
422 
423  //
424  // const member functions
425  //
426 
427  //
428  // static member functions
429  //
430 }
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_
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
PostModuleConstruction postModuleConstructionSignal_