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
19 
20 //
21 // constants, enums and typedefs
22 //
23 
24 //
25 // static data member definitions
26 //
27 
28 //
29 // constructors and destructor
30 //
31 //ActivityRegistry::ActivityRegistry() {
32 //}
33 
34 // ActivityRegistry::ActivityRegistry(ActivityRegistry const& rhs) {
35 // // do actual copying here;
36 // }
37 
38 //ActivityRegistry::~ActivityRegistry() {
39 //}
40 
41 //
42 // assignment operators
43 //
44 // ActivityRegistry const& ActivityRegistry::operator=(ActivityRegistry const& rhs) {
45 // //An exception safe implementation is
46 // ActivityRegistry temp(rhs);
47 // swap(rhs);
48 //
49 // return *this;
50 // }
51 
52 //
53 // member functions
54 //
55 namespace edm {
56  namespace {
57  template<typename T>
58  inline
59  void
60  copySlotsToFrom(T& iTo, T& iFrom) {
61  for(auto& slot: iFrom.slots()) {
62  iTo.connect(slot);
63  }
64  }
65 
66  template<typename T>
67  inline
68  void
69  copySlotsToFromReverse(T& iTo, T& iFrom) {
70  // This handles service slots that are supposed to be in reverse
71  // order of construction. Copying new ones in is a little
72  // tricky. Here is an example of what follows
73  // slots in iTo before 4 3 2 1 and copy in slots in iFrom 8 7 6 5.
74  // reverse iFrom 5 6 7 8
75  // then do the copy to front 8 7 6 5 4 3 2 1
76 
77  auto slotsFrom = iFrom.slots();
78 
79  std::reverse(slotsFrom.begin(), slotsFrom.end());
80 
81  for(auto& slotFrom: slotsFrom) {
82  iTo.connect_front(slotFrom);
83  }
84  }
85  }
86 
87  void
89 
91  postEndJobSignal_.connect(std::cref(iOther.postEndJobSignal_));
92 
93  jobFailureSignal_.connect(std::cref(iOther.jobFailureSignal_));
94 
95  preSourceSignal_.connect(std::cref(iOther.preSourceSignal_));
96  postSourceSignal_.connect(std::cref(iOther.postSourceSignal_));
97 
100 
103 
104  preOpenFileSignal_.connect(std::cref(iOther.preOpenFileSignal_));
106 
109 
112 
115 
116  preBeginRunSignal_.connect(std::cref(iOther.preBeginRunSignal_));
118 
119  preEndRunSignal_.connect(std::cref(iOther.preEndRunSignal_));
120  postEndRunSignal_.connect(std::cref(iOther.postEndRunSignal_));
121 
124 
125  preEndLumiSignal_.connect(std::cref(iOther.preEndLumiSignal_));
126  postEndLumiSignal_.connect(std::cref(iOther.postEndLumiSignal_));
127 
130  }
131 
132  void
134 
137 
140 
143 
146 
149 
150  preModuleSignal_.connect(std::cref(iOther.preModuleSignal_));
151  postModuleSignal_.connect(std::cref(iOther.postModuleSignal_));
152 
155 
158 
161 
164 
167 
170 
173  }
174 
175  void
177  connectGlobals(iOther);
178  connectLocals(iOther);
179  }
180 
181  void
183  connectGlobals(iOther);
184  iOther.connectLocals(*this);
185  }
186 
187  void
189  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
190  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
191 
192  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
193 
194  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
195  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
196 
197  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
198  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
199 
200  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
201  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
202 
203  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
204  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
205 
206  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
207  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
208 
209  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
210  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
211 
212  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
213  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
214 
215  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
216  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
217 
218  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
219  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
220 
221  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
222  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
223 
224  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
225  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
226 
227  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
228  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
229 
230  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
231  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
232 
233  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
234  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
235 
236  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
237  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
238 
239  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
240  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
241 
242  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
243  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
244 
245  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
246  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
247 
248  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
249  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
250 
251  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
252  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
253 
255  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
256 
257  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
258  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
259 
260  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
261  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
262 
264  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
265 
268  }
269 
270  //
271  // const member functions
272  //
273 
274  //
275  // static member functions
276  //
277 }
PostSourceLumi postSourceLumiSignal_
void connectLocals(ActivityRegistry &iOther)
PreModuleBeginLumi preModuleBeginLumiSignal_
PreBeginLumi preBeginLumiSignal_
signal is emitted after the Lumi has been created by the InputSource but before any modules have seen...
PreEndRun preEndRunSignal_
signal is emitted before the endRun is processed
PreSourceRun preSourceRunSignal_
PostOpenFile postOpenFileSignal_
PreModuleEndRun preModuleEndRunSignal_
PostModuleEndRun postModuleEndRunSignal_
PostModuleEndLumi postModuleEndLumiSignal_
void connectGlobals(ActivityRegistry &iOther)
void copySlotsFrom(ActivityRegistry &iOther)
PreEndLumi preEndLumiSignal_
signal is emitted before the endLumi is processed
PostSourceRun postSourceRunSignal_
PostSourceConstruction postSourceConstructionSignal_
PostBeginRun postBeginRunSignal_
signal is emitted after all modules have finished processing the beginRun
PreSourceConstruction preSourceConstructionSignal_
PostPathEndRun postPathEndRunSignal_
PostPathBeginRun postPathBeginRunSignal_
PreForkReleaseResources preForkReleaseResourcesSignal_
PreModuleBeginRun preModuleBeginRunSignal_
PostForkReacquireResources postForkReacquireResourcesSignal_
PrePathBeginLumi prePathBeginLumiSignal_
PrePathEndRun prePathEndRunSignal_
PostPathEndLumi postPathEndLumiSignal_
PostProcessEvent postProcessEventSignal_
signal is emitted after all modules have finished processing the Event
PreModuleConstruction preModuleConstructionSignal_
PostEndRun postEndRunSignal_
signal is emitted after all modules have finished processing the Run
PreCloseFile preCloseFileSignal_
PostModuleBeginLumi postModuleBeginLumiSignal_
PostEndLumi postEndLumiSignal_
signal is emitted after all modules have finished processing the Lumi
PostCloseFile postCloseFileSignal_
PostModuleEndJob postModuleEndJobSignal_
PostModuleBeginJob postModuleBeginJobSignal_
void connectToSubProcess(ActivityRegistry &iOther)
PreSourceLumi preSourceLumiSignal_
PostModuleBeginRun postModuleBeginRunSignal_
PrePathEndLumi prePathEndLumiSignal_
PreProcessPath preProcessPathSignal_
PreProcessEvent preProcessEventSignal_
signal is emitted after the Event has been created by the InputSource but before any modules have see...
PreOpenFile preOpenFileSignal_
PreModuleEndLumi preModuleEndLumiSignal_
PostEndJob postEndJobSignal_
signal is emitted after all modules have gotten their endJob called
PreModuleBeginJob preModuleBeginJobSignal_
long double T
PostBeginJob postBeginJobSignal_
signal is emitted after all modules have gotten their beginJob called
PreModuleEndJob preModuleEndJobSignal_
PrePathBeginRun prePathBeginRunSignal_
void connect(U iFunc)
Definition: Signal.h:64
PostPathBeginLumi postPathBeginLumiSignal_
PostProcessPath postProcessPathSignal_
PreBeginRun preBeginRunSignal_
signal is emitted after the Run has been created by the InputSource but before any modules have seen ...
PostBeginLumi postBeginLumiSignal_
signal is emitted after all modules have finished processing the beginLumi
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther
PostModuleConstruction postModuleConstructionSignal_