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  typename T::slot_list_type slots = iFrom.slots();
62 
63  for_all(slots, boost::bind(&T::connect, iTo, _1));
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 both 1 2 3 4 plus 5 6 7 8
75  // then do the copy 1 2 3 4 5 6 7 8
76  // then reverse back again to get the desired order
77  // 8 7 6 5 4 3 2 1
78 
79  typename T::slot_list_type slotsFrom = iFrom.slots();
80  typename T::slot_list_type slotsTo = iTo.slots();
81 
82  std::reverse(slotsTo.begin(), slotsTo.end());
83  std::reverse(slotsFrom.begin(), slotsFrom.end());
84 
85  for_all(slotsFrom, boost::bind(&T::connect, iTo, _1));
86 
87  std::reverse(slotsTo.begin(), slotsTo.end());
88 
89  // Be nice and put these back in the state they were
90  // at the beginning
91  std::reverse(slotsFrom.begin(), slotsFrom.end());
92  }
93  }
94 
95  void
97 
99  postEndJobSignal_.connect(iOther.postEndJobSignal_);
100 
101  jobFailureSignal_.connect(iOther.jobFailureSignal_);
102 
103  preSourceSignal_.connect(iOther.preSourceSignal_);
104  postSourceSignal_.connect(iOther.postSourceSignal_);
105 
108 
111 
112  preOpenFileSignal_.connect(iOther.preOpenFileSignal_);
114 
117 
120 
123 
124  preBeginRunSignal_.connect(iOther.preBeginRunSignal_);
126 
127  preEndRunSignal_.connect(iOther.preEndRunSignal_);
128  postEndRunSignal_.connect(iOther.postEndRunSignal_);
129 
132 
133  preEndLumiSignal_.connect(iOther.preEndLumiSignal_);
134  postEndLumiSignal_.connect(iOther.postEndLumiSignal_);
135 
138  }
139 
140  void
142 
145 
148 
151 
154 
157 
158  preModuleSignal_.connect(iOther.preModuleSignal_);
159  postModuleSignal_.connect(iOther.postModuleSignal_);
160 
163 
166 
169 
172 
175 
178 
181  }
182 
183  void
185  connectGlobals(iOther);
186  connectLocals(iOther);
187  }
188 
189  void
191  connectGlobals(iOther);
192  iOther.connectLocals(*this);
193  }
194 
195  void
197  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
198  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
199 
200  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
201 
202  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
203  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
204 
205  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
206  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
207 
208  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
209  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
210 
211  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
212  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
213 
214  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
215  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
216 
217  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
218  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
219 
220  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
221  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
222 
223  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
224  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
225 
226  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
227  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
228 
229  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
230  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
231 
232  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
233  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
234 
235  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
236  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
237 
238  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
239  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
240 
241  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
242  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
243 
244  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
245  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
246 
247  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
248  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
249 
250  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
251  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
252 
253  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
254  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
255 
256  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
257  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
258 
259  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
260  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
261 
263  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
264 
265  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
266  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
267 
268  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
269  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
270 
272  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
273 
276  }
277 
278  //
279  // const member functions
280  //
281 
282  //
283  // static member functions
284  //
285 }
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_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
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_
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_