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  }
124 
125  void
127 
130 
133 
136 
139 
142 
145 
148 
151 
154 
157 
158  preEventSignal_.connect(std::cref(iOther.preEventSignal_));
159  postEventSignal_.connect(std::cref(iOther.postEventSignal_));
160 
163 
164  //preProcessEventSignal_.connect(std::cref(iOther.preProcessEventSignal_));
165  //postProcessEventSignal_.connect(std::cref(iOther.postProcessEventSignal_));
166 
167  //preBeginRunSignal_.connect(std::cref(iOther.preBeginRunSignal_));
168  //postBeginRunSignal_.connect(std::cref(iOther.postBeginRunSignal_));
169 
170  //preEndRunSignal_.connect(std::cref(iOther.preEndRunSignal_));
171  //postEndRunSignal_.connect(std::cref(iOther.postEndRunSignal_));
172 
173  //preBeginLumiSignal_.connect(std::cref(iOther.preBeginLumiSignal_));
174  //postBeginLumiSignal_.connect(std::cref(iOther.postBeginLumiSignal_));
175 
176  //preEndLumiSignal_.connect(std::cref(iOther.preEndLumiSignal_));
177  //postEndLumiSignal_.connect(std::cref(iOther.postEndLumiSignal_));
178 
179  //preProcessPathSignal_.connect(std::cref(iOther.preProcessPathSignal_));
180  //postProcessPathSignal_.connect(std::cref(iOther.postProcessPathSignal_));
181 
182  //prePathBeginRunSignal_.connect(std::cref(iOther.prePathBeginRunSignal_));
183  //postPathBeginRunSignal_.connect(std::cref(iOther.postPathBeginRunSignal_));
184 
185  //prePathEndRunSignal_.connect(std::cref(iOther.prePathEndRunSignal_));
186  //postPathEndRunSignal_.connect(std::cref(iOther.postPathEndRunSignal_));
187 
188  //prePathBeginLumiSignal_.connect(std::cref(iOther.prePathBeginLumiSignal_));
189  //postPathBeginLumiSignal_.connect(std::cref(iOther.postPathBeginLumiSignal_));
190 
191  //prePathEndLumiSignal_.connect(std::cref(iOther.prePathEndLumiSignal_));
192  //postPathEndLumiSignal_.connect(std::cref(iOther.postPathEndLumiSignal_));
193 
196 
199 
202 
205 
208 
209 
212 
215 
218 
221 
224 
227 
230 
233 
234  //preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
235  //postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
236 
237  //preModuleBeginRunSignal_.connect(std::cref(iOther.preModuleBeginRunSignal_));
238  //postModuleBeginRunSignal_.connect(std::cref(iOther.postModuleBeginRunSignal_));
239 
240  //preModuleEndRunSignal_.connect(std::cref(iOther.preModuleEndRunSignal_));
241  //postModuleEndRunSignal_.connect(std::cref(iOther.postModuleEndRunSignal_));
242 
243  //preModuleBeginLumiSignal_.connect(std::cref(iOther.preModuleBeginLumiSignal_));
244  //postModuleBeginLumiSignal_.connect(std::cref(iOther.postModuleBeginLumiSignal_));
245 
246  //preModuleEndLumiSignal_.connect(std::cref(iOther.preModuleEndLumiSignal_));
247  //postModuleEndLumiSignal_.connect(std::cref(iOther.postModuleEndLumiSignal_));
248  }
249 
250  void
252  connectGlobals(iOther);
253  connectLocals(iOther);
254  }
255 
256  void
258  connectGlobals(iOther); // child sees parents global signals
259  iOther.connectLocals(*this); // parent see childs global signals
260  }
261 
262  void
264  copySlotsToFrom(preallocateSignal_,iOther.preallocateSignal_);
265  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
266  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
267 
268  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
269 
270  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
271  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
272 
273  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
274  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
275 
276  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
277  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
278 
279  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
280  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
281 
282  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
283  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
284 
286  copySlotsToFromReverse(postModuleBeginStreamSignal_, iOther.postModuleBeginStreamSignal_);
287 
288  copySlotsToFrom(preModuleEndStreamSignal_, iOther.preModuleEndStreamSignal_);
289  copySlotsToFromReverse(postModuleEndStreamSignal_, iOther.postModuleEndStreamSignal_);
290 
291  copySlotsToFrom(preGlobalBeginRunSignal_, iOther.preGlobalBeginRunSignal_);
292  copySlotsToFromReverse(postGlobalBeginRunSignal_, iOther.postGlobalBeginRunSignal_);
293 
294  copySlotsToFrom(preGlobalEndRunSignal_, iOther.preGlobalEndRunSignal_);
295  copySlotsToFromReverse(postGlobalEndRunSignal_, iOther.postGlobalEndRunSignal_);
296 
297  copySlotsToFrom(preStreamBeginRunSignal_, iOther.preStreamBeginRunSignal_);
298  copySlotsToFromReverse(postStreamBeginRunSignal_, iOther.postStreamBeginRunSignal_);
299 
300  copySlotsToFrom(preStreamEndRunSignal_, iOther.preStreamEndRunSignal_);
301  copySlotsToFromReverse(postStreamEndRunSignal_, iOther.postStreamEndRunSignal_);
302 
303  copySlotsToFrom(preGlobalBeginLumiSignal_, iOther.preGlobalBeginLumiSignal_);
304  copySlotsToFromReverse(postGlobalBeginLumiSignal_, iOther.postGlobalBeginLumiSignal_);
305 
306  copySlotsToFrom(preGlobalEndLumiSignal_, iOther.preGlobalEndLumiSignal_);
307  copySlotsToFromReverse(postGlobalEndLumiSignal_, iOther.postGlobalEndLumiSignal_);
308 
309  copySlotsToFrom(preStreamBeginLumiSignal_, iOther.preStreamBeginLumiSignal_);
310  copySlotsToFromReverse(postStreamBeginLumiSignal_, iOther.postStreamBeginLumiSignal_);
311 
312  copySlotsToFrom(preStreamEndLumiSignal_, iOther.preStreamEndLumiSignal_);
313  copySlotsToFromReverse(postStreamEndLumiSignal_, iOther.postStreamEndLumiSignal_);
314 
315  copySlotsToFrom(preEventSignal_, iOther.preEventSignal_);
316  copySlotsToFromReverse(postEventSignal_, iOther.postEventSignal_);
317 
318  copySlotsToFrom(prePathEventSignal_, iOther.prePathEventSignal_);
319  copySlotsToFromReverse(postPathEventSignal_, iOther.postPathEventSignal_);
320 
321  /*
322  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
323  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
324 
325  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
326  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
327 
328  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
329  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
330 
331  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
332  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
333 
334  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
335  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
336 
337  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
338  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
339 
340  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
341  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
342 
343  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
344  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
345 
346  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
347  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
348 
349  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
350  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
351 */
353  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
354 
355  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
356  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
357 
358  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
359  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
360 
361  copySlotsToFrom(preModuleEventSignal_, iOther.preModuleEventSignal_);
362  copySlotsToFromReverse(postModuleEventSignal_, iOther.postModuleEventSignal_);
363 
366 
369 
371  copySlotsToFromReverse(postModuleStreamEndRunSignal_, iOther.postModuleStreamEndRunSignal_);
372 
375 
377  copySlotsToFromReverse(postModuleStreamEndLumiSignal_, iOther.postModuleStreamEndLumiSignal_);
378 
381 
383  copySlotsToFromReverse(postModuleGlobalEndRunSignal_, iOther.postModuleGlobalEndRunSignal_);
384 
387 
389  copySlotsToFromReverse(postModuleGlobalEndLumiSignal_, iOther.postModuleGlobalEndLumiSignal_);
390 
391  /*
392  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
393  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
394 
395  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
396  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
397 
398  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
399  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
400 
401  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
402  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
403 
404  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
405  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
406  */
408  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
409 
412  }
413 
414  //
415  // const member functions
416  //
417 
418  //
419  // static member functions
420  //
421 }
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_
PostModuleGlobalEndRun postModuleGlobalEndRunSignal_
PostModuleGlobalEndLumi postModuleGlobalEndLumiSignal_
PreModuleStreamEndRun preModuleStreamEndRunSignal_
PostStreamEndRun postStreamEndRunSignal_
PreStreamEndRun preStreamEndRunSignal_
PreModuleConstruction preModuleConstructionSignal_
PostModuleEndStream postModuleEndStreamSignal_
PreGlobalEndLumi preGlobalEndLumiSignal_
PostSourceEvent postSourceSignal_
PreCloseFile preCloseFileSignal_
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_