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<class 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<class 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 
121  preBeginRunSignal_.connect(iOther.preBeginRunSignal_);
123 
124  preEndRunSignal_.connect(iOther.preEndRunSignal_);
125  postEndRunSignal_.connect(iOther.postEndRunSignal_);
126 
129 
130  preEndLumiSignal_.connect(iOther.preEndLumiSignal_);
131  postEndLumiSignal_.connect(iOther.postEndLumiSignal_);
132 
135 
138 
141 
144 
147 
148  preModuleSignal_.connect(iOther.preModuleSignal_);
149  postModuleSignal_.connect(iOther.postModuleSignal_);
150 
153 
156 
159 
162 
165 
168 
171 
174 
177  }
178 
179  void
181  copySlotsToFrom(postBeginJobSignal_, iOther.postBeginJobSignal_);
182  copySlotsToFromReverse(postEndJobSignal_, iOther.postEndJobSignal_);
183 
184  copySlotsToFromReverse(jobFailureSignal_, iOther.jobFailureSignal_);
185 
186  copySlotsToFrom(preSourceSignal_, iOther.preSourceSignal_);
187  copySlotsToFromReverse(postSourceSignal_, iOther.postSourceSignal_);
188 
189  copySlotsToFrom(preSourceLumiSignal_, iOther.preSourceLumiSignal_);
190  copySlotsToFromReverse(postSourceLumiSignal_, iOther.postSourceLumiSignal_);
191 
192  copySlotsToFrom(preSourceRunSignal_, iOther.preSourceRunSignal_);
193  copySlotsToFromReverse(postSourceRunSignal_, iOther.postSourceRunSignal_);
194 
195  copySlotsToFrom(preOpenFileSignal_, iOther.preOpenFileSignal_);
196  copySlotsToFromReverse(postOpenFileSignal_, iOther.postOpenFileSignal_);
197 
198  copySlotsToFrom(preCloseFileSignal_, iOther.preCloseFileSignal_);
199  copySlotsToFromReverse(postCloseFileSignal_, iOther.postCloseFileSignal_);
200 
201  copySlotsToFrom(preProcessEventSignal_, iOther.preProcessEventSignal_);
202  copySlotsToFromReverse(postProcessEventSignal_, iOther.postProcessEventSignal_);
203 
204  copySlotsToFrom(preBeginRunSignal_, iOther.preBeginRunSignal_);
205  copySlotsToFromReverse(postBeginRunSignal_, iOther.postBeginRunSignal_);
206 
207  copySlotsToFrom(preEndRunSignal_, iOther.preEndRunSignal_);
208  copySlotsToFromReverse(postEndRunSignal_, iOther.postEndRunSignal_);
209 
210  copySlotsToFrom(preBeginLumiSignal_, iOther.preBeginLumiSignal_);
211  copySlotsToFromReverse(postBeginLumiSignal_, iOther.postBeginLumiSignal_);
212 
213  copySlotsToFrom(preEndLumiSignal_, iOther.preEndLumiSignal_);
214  copySlotsToFromReverse(postEndLumiSignal_, iOther.postEndLumiSignal_);
215 
216  copySlotsToFrom(preProcessPathSignal_, iOther.preProcessPathSignal_);
217  copySlotsToFromReverse(postProcessPathSignal_, iOther.postProcessPathSignal_);
218 
219  copySlotsToFrom(prePathBeginRunSignal_, iOther.prePathBeginRunSignal_);
220  copySlotsToFromReverse(postPathBeginRunSignal_, iOther.postPathBeginRunSignal_);
221 
222  copySlotsToFrom(prePathEndRunSignal_, iOther.prePathEndRunSignal_);
223  copySlotsToFromReverse(postPathEndRunSignal_, iOther.postPathEndRunSignal_);
224 
225  copySlotsToFrom(prePathBeginLumiSignal_, iOther.prePathBeginLumiSignal_);
226  copySlotsToFromReverse(postPathBeginLumiSignal_, iOther.postPathBeginLumiSignal_);
227 
228  copySlotsToFrom(prePathEndLumiSignal_, iOther.prePathEndLumiSignal_);
229  copySlotsToFromReverse(postPathEndLumiSignal_, iOther.postPathEndLumiSignal_);
230 
231  copySlotsToFrom(preModuleSignal_, iOther.preModuleSignal_);
232  copySlotsToFromReverse(postModuleSignal_, iOther.postModuleSignal_);
233 
234  copySlotsToFrom(preModuleBeginRunSignal_, iOther.preModuleBeginRunSignal_);
235  copySlotsToFromReverse(postModuleBeginRunSignal_, iOther.postModuleBeginRunSignal_);
236 
237  copySlotsToFrom(preModuleEndRunSignal_, iOther.preModuleEndRunSignal_);
238  copySlotsToFromReverse(postModuleEndRunSignal_, iOther.postModuleEndRunSignal_);
239 
240  copySlotsToFrom(preModuleBeginLumiSignal_, iOther.preModuleBeginLumiSignal_);
241  copySlotsToFromReverse(postModuleBeginLumiSignal_, iOther.postModuleBeginLumiSignal_);
242 
243  copySlotsToFrom(preModuleEndLumiSignal_, iOther.preModuleEndLumiSignal_);
244  copySlotsToFromReverse(postModuleEndLumiSignal_, iOther.postModuleEndLumiSignal_);
245 
247  copySlotsToFromReverse(postModuleConstructionSignal_, iOther.postModuleConstructionSignal_);
248 
249  copySlotsToFrom(preModuleBeginJobSignal_, iOther.preModuleBeginJobSignal_);
250  copySlotsToFromReverse(postModuleBeginJobSignal_, iOther.postModuleBeginJobSignal_);
251 
252  copySlotsToFrom(preModuleEndJobSignal_, iOther.preModuleEndJobSignal_);
253  copySlotsToFromReverse(postModuleEndJobSignal_, iOther.postModuleEndJobSignal_);
254 
256  copySlotsToFromReverse(postSourceConstructionSignal_, iOther.postSourceConstructionSignal_);
257 
260  }
261 
262  //
263  // const member functions
264  //
265 
266  //
267  // static member functions
268  //
269 }
PostSourceLumi postSourceLumiSignal_
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 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_
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_
tuple connect
process.AlignmentProducer.algoConfig.uvarFile = &#39;.
Definition: align_tpl.py:66
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_