00001 #ifndef FWCore_ServiceRegistry_ActivityRegistry_h
00002 #define FWCore_ServiceRegistry_ActivityRegistry_h
00003
00004
00005
00006
00007
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "sigc++/signal.h"
00025 #include "boost/bind.hpp"
00026 #include "boost/mem_fn.hpp"
00027 #include "boost/utility.hpp"
00028
00029
00030
00031 #define AR_WATCH_USING_METHOD_0(method) template<class TClass, class TMethod> void method (TClass* iObject, TMethod iMethod) { method (boost::bind(boost::mem_fn(iMethod), iObject)); }
00032 #define AR_WATCH_USING_METHOD_1(method) template<class TClass, class TMethod> void method (TClass* iObject, TMethod iMethod) { method (boost::bind(boost::mem_fn(iMethod), iObject, _1)); }
00033 #define AR_WATCH_USING_METHOD_2(method) template<class TClass, class TMethod> void method (TClass* iObject, TMethod iMethod) { method (boost::bind(boost::mem_fn(iMethod), iObject, _1,_2)); }
00034
00035 namespace edm {
00036 class EventID;
00037 class LuminosityBlockID;
00038 class RunID;
00039 class Timestamp;
00040 class ModuleDescription;
00041 class Event;
00042 class LuminosityBlock;
00043 class Run;
00044 class EventSetup;
00045 class HLTPathStatus;
00046
00047 struct ActivityRegistry : private boost::noncopyable
00048 {
00049 ActivityRegistry() {}
00050
00051
00052 typedef sigc::signal<void> PostBeginJob;
00054 PostBeginJob postBeginJobSignal_;
00056 void watchPostBeginJob(PostBeginJob::slot_type const& iSlot) {
00057 postBeginJobSignal_.connect(iSlot);
00058 }
00059 AR_WATCH_USING_METHOD_0(watchPostBeginJob)
00060
00061 typedef sigc::signal<void> PostEndJob;
00063 PostEndJob postEndJobSignal_;
00064 void watchPostEndJob(PostEndJob::slot_type const& iSlot) {
00065 PostEndJob::slot_list_type sl = postEndJobSignal_.slots();
00066 sl.push_front(iSlot);
00067 }
00068 AR_WATCH_USING_METHOD_0(watchPostEndJob)
00069
00070 typedef sigc::signal<void> JobFailure;
00073 JobFailure jobFailureSignal_;
00075 void watchJobFailure(JobFailure::slot_type const& iSlot) {
00076 JobFailure::slot_list_type sl = jobFailureSignal_.slots();
00077 sl.push_front(iSlot);
00078 }
00079 AR_WATCH_USING_METHOD_0(watchJobFailure)
00080
00081
00082 typedef sigc::signal<void> PreSource;
00083 PreSource preSourceSignal_;
00084 void watchPreSource(PreSource::slot_type const& iSlot) {
00085 preSourceSignal_.connect(iSlot);
00086 }
00087 AR_WATCH_USING_METHOD_0(watchPreSource)
00088
00089
00090 typedef sigc::signal<void> PostSource;
00091 PostSource postSourceSignal_;
00092 void watchPostSource(PostSource::slot_type const& iSlot) {
00093 PostSource::slot_list_type sl = postSourceSignal_.slots();
00094 sl.push_front(iSlot);
00095 }
00096 AR_WATCH_USING_METHOD_0(watchPostSource)
00097
00098
00099 typedef sigc::signal<void> PreSourceLumi;
00100 PreSourceLumi preSourceLumiSignal_;
00101 void watchPreSourceLumi(PreSourceLumi::slot_type const& iSlot) {
00102 preSourceLumiSignal_.connect(iSlot);
00103 }
00104 AR_WATCH_USING_METHOD_0(watchPreSourceLumi)
00105
00106
00107 typedef sigc::signal<void> PostSourceLumi;
00108 PostSourceLumi postSourceLumiSignal_;
00109 void watchPostSourceLumi(PostSourceLumi::slot_type const& iSlot) {
00110 PostSourceLumi::slot_list_type sl = postSourceLumiSignal_.slots();
00111 sl.push_front(iSlot);
00112 }
00113 AR_WATCH_USING_METHOD_0(watchPostSourceLumi)
00114
00115
00116 typedef sigc::signal<void> PreSourceRun;
00117 PreSourceRun preSourceRunSignal_;
00118 void watchPreSourceRun(PreSourceRun::slot_type const& iSlot) {
00119 preSourceRunSignal_.connect(iSlot);
00120 }
00121 AR_WATCH_USING_METHOD_0(watchPreSourceRun)
00122
00123
00124 typedef sigc::signal<void> PostSourceRun;
00125 PostSourceRun postSourceRunSignal_;
00126 void watchPostSourceRun(PostSourceRun::slot_type const& iSlot) {
00127 PostSourceRun::slot_list_type sl = postSourceRunSignal_.slots();
00128 sl.push_front(iSlot);
00129 }
00130 AR_WATCH_USING_METHOD_0(watchPostSourceRun)
00131
00132
00133 typedef sigc::signal<void> PreOpenFile;
00134 PreOpenFile preOpenFileSignal_;
00135 void watchPreOpenFile(PreOpenFile::slot_type const& iSlot) {
00136 preOpenFileSignal_.connect(iSlot);
00137 }
00138 AR_WATCH_USING_METHOD_0(watchPreOpenFile)
00139
00140
00141 typedef sigc::signal<void> PostOpenFile;
00142 PostOpenFile postOpenFileSignal_;
00143 void watchPostOpenFile(PostOpenFile::slot_type const& iSlot) {
00144 PostOpenFile::slot_list_type sl = postOpenFileSignal_.slots();
00145 sl.push_front(iSlot);
00146 }
00147 AR_WATCH_USING_METHOD_0(watchPostOpenFile)
00148
00149
00150 typedef sigc::signal<void> PreCloseFile;
00151 PreCloseFile preCloseFileSignal_;
00152 void watchPreCloseFile(PreCloseFile::slot_type const& iSlot) {
00153 preCloseFileSignal_.connect(iSlot);
00154 }
00155 AR_WATCH_USING_METHOD_0(watchPreCloseFile)
00156
00157
00158 typedef sigc::signal<void> PostCloseFile;
00159 PostCloseFile postCloseFileSignal_;
00160 void watchPostCloseFile(PostCloseFile::slot_type const& iSlot) {
00161 PostCloseFile::slot_list_type sl = postCloseFileSignal_.slots();
00162 sl.push_front(iSlot);
00163 }
00164 AR_WATCH_USING_METHOD_0(watchPostCloseFile)
00165
00166 typedef sigc::signal<void, edm::EventID const&, edm::Timestamp const&> PreProcessEvent;
00168 PreProcessEvent preProcessEventSignal_;
00169 void watchPreProcessEvent(PreProcessEvent::slot_type const& iSlot) {
00170 preProcessEventSignal_.connect(iSlot);
00171 }
00172 AR_WATCH_USING_METHOD_2(watchPreProcessEvent)
00173
00174 typedef sigc::signal<void, Event const&, EventSetup const&> PostProcessEvent;
00176 PostProcessEvent postProcessEventSignal_;
00177 void watchPostProcessEvent(PostProcessEvent::slot_type const& iSlot) {
00178 PostProcessEvent::slot_list_type sl = postProcessEventSignal_.slots();
00179 sl.push_front(iSlot);
00180 }
00181 AR_WATCH_USING_METHOD_2(watchPostProcessEvent)
00182
00183 typedef sigc::signal<void, edm::RunID const&, edm::Timestamp const&> PreBeginRun;
00185 PreBeginRun preBeginRunSignal_;
00186 void watchPreBeginRun(PreBeginRun::slot_type const& iSlot) {
00187 preBeginRunSignal_.connect(iSlot);
00188 }
00189 AR_WATCH_USING_METHOD_2(watchPreBeginRun)
00190
00191 typedef sigc::signal<void, Run const&, EventSetup const&> PostBeginRun;
00193 PostBeginRun postBeginRunSignal_;
00194 void watchPostBeginRun(PostBeginRun::slot_type const& iSlot) {
00195 PostBeginRun::slot_list_type sl = postBeginRunSignal_.slots();
00196 sl.push_front(iSlot);
00197 }
00198 AR_WATCH_USING_METHOD_2(watchPostBeginRun)
00199
00200 typedef sigc::signal<void, edm::RunID const&, edm::Timestamp const&> PreEndRun;
00202 PreEndRun preEndRunSignal_;
00203 void watchPreEndRun(PreEndRun::slot_type const& iSlot) {
00204 preEndRunSignal_.connect(iSlot);
00205 }
00206 AR_WATCH_USING_METHOD_2(watchPreEndRun)
00207
00208 typedef sigc::signal<void, Run const&, EventSetup const&> PostEndRun;
00210 PostEndRun postEndRunSignal_;
00211 void watchPostEndRun(PostEndRun::slot_type const& iSlot) {
00212 PostEndRun::slot_list_type sl = postEndRunSignal_.slots();
00213 sl.push_front(iSlot);
00214 }
00215 AR_WATCH_USING_METHOD_2(watchPostEndRun)
00216
00217 typedef sigc::signal<void, edm::LuminosityBlockID const&, edm::Timestamp const&> PreBeginLumi;
00219 PreBeginLumi preBeginLumiSignal_;
00220 void watchPreBeginLumi(PreBeginLumi::slot_type const& iSlot) {
00221 preBeginLumiSignal_.connect(iSlot);
00222 }
00223 AR_WATCH_USING_METHOD_2(watchPreBeginLumi)
00224
00225 typedef sigc::signal<void, LuminosityBlock const&, EventSetup const&> PostBeginLumi;
00227 PostBeginLumi postBeginLumiSignal_;
00228 void watchPostBeginLumi(PostBeginLumi::slot_type const& iSlot) {
00229 PostBeginLumi::slot_list_type sl = postBeginLumiSignal_.slots();
00230 sl.push_front(iSlot);
00231 }
00232 AR_WATCH_USING_METHOD_2(watchPostBeginLumi)
00233
00234 typedef sigc::signal<void, edm::LuminosityBlockID const&, edm::Timestamp const&> PreEndLumi;
00236 PreEndLumi preEndLumiSignal_;
00237 void watchPreEndLumi(PreEndLumi::slot_type const& iSlot) {
00238 preEndLumiSignal_.connect(iSlot);
00239 }
00240 AR_WATCH_USING_METHOD_2(watchPreEndLumi)
00241
00242 typedef sigc::signal<void, LuminosityBlock const&, EventSetup const&> PostEndLumi;
00244 PostEndLumi postEndLumiSignal_;
00245 void watchPostEndLumi(PostEndLumi::slot_type const& iSlot) {
00246 PostEndLumi::slot_list_type sl = postEndLumiSignal_.slots();
00247 sl.push_front(iSlot);
00248 }
00249 AR_WATCH_USING_METHOD_2(watchPostEndLumi)
00250
00251
00252 typedef sigc::signal<void, std::string const&> PreProcessPath;
00253 PreProcessPath preProcessPathSignal_;
00254 void watchPreProcessPath(PreProcessPath::slot_type const& iSlot) {
00255 preProcessPathSignal_.connect(iSlot);
00256 }
00257 AR_WATCH_USING_METHOD_1(watchPreProcessPath)
00258
00259
00260 typedef sigc::signal<void, std::string const&, HLTPathStatus const&> PostProcessPath;
00261 PostProcessPath postProcessPathSignal_;
00262 void watchPostProcessPath(PostProcessPath::slot_type const& iSlot) {
00263 PostProcessPath::slot_list_type sl = postProcessPathSignal_.slots();
00264 sl.push_front(iSlot);
00265 }
00266 AR_WATCH_USING_METHOD_2(watchPostProcessPath)
00267
00268
00269 typedef sigc::signal<void, std::string const&> PrePathBeginRun;
00270 PrePathBeginRun prePathBeginRunSignal_;
00271 void watchPrePathBeginRun(PrePathBeginRun::slot_type const& iSlot) {
00272 prePathBeginRunSignal_.connect(iSlot);
00273 }
00274 AR_WATCH_USING_METHOD_1(watchPrePathBeginRun)
00275
00276
00277 typedef sigc::signal<void, std::string const&, HLTPathStatus const&> PostPathBeginRun;
00278 PostPathBeginRun postPathBeginRunSignal_;
00279 void watchPostPathBeginRun(PostPathBeginRun::slot_type const& iSlot) {
00280 PostPathBeginRun::slot_list_type sl = postPathBeginRunSignal_.slots();
00281 sl.push_front(iSlot);
00282 }
00283 AR_WATCH_USING_METHOD_2(watchPostPathBeginRun)
00284
00285
00286 typedef sigc::signal<void, std::string const&> PrePathEndRun;
00287 PrePathEndRun prePathEndRunSignal_;
00288 void watchPrePathEndRun(PrePathEndRun::slot_type const& iSlot) {
00289 prePathEndRunSignal_.connect(iSlot);
00290 }
00291 AR_WATCH_USING_METHOD_1(watchPrePathEndRun)
00292
00293
00294 typedef sigc::signal<void, std::string const&, HLTPathStatus const&> PostPathEndRun;
00295 PostPathEndRun postPathEndRunSignal_;
00296 void watchPostPathEndRun(PostPathEndRun::slot_type const& iSlot) {
00297 PostPathEndRun::slot_list_type sl = postPathEndRunSignal_.slots();
00298 sl.push_front(iSlot);
00299 }
00300 AR_WATCH_USING_METHOD_2(watchPostPathEndRun)
00301
00302
00303 typedef sigc::signal<void, std::string const&> PrePathBeginLumi;
00304 PrePathBeginLumi prePathBeginLumiSignal_;
00305 void watchPrePathBeginLumi(PrePathBeginLumi::slot_type const& iSlot) {
00306 prePathBeginLumiSignal_.connect(iSlot);
00307 }
00308 AR_WATCH_USING_METHOD_1(watchPrePathBeginLumi)
00309
00310
00311 typedef sigc::signal<void, std::string const&, HLTPathStatus const&> PostPathBeginLumi;
00312 PostPathBeginLumi postPathBeginLumiSignal_;
00313 void watchPostPathBeginLumi(PostPathBeginLumi::slot_type const& iSlot) {
00314 PostPathBeginLumi::slot_list_type sl = postPathBeginLumiSignal_.slots();
00315 sl.push_front(iSlot);
00316 }
00317 AR_WATCH_USING_METHOD_2(watchPostPathBeginLumi)
00318
00319
00320 typedef sigc::signal<void, std::string const&> PrePathEndLumi;
00321 PrePathEndLumi prePathEndLumiSignal_;
00322 void watchPrePathEndLumi(PrePathEndLumi::slot_type const& iSlot) {
00323 prePathEndLumiSignal_.connect(iSlot);
00324 }
00325 AR_WATCH_USING_METHOD_1(watchPrePathEndLumi)
00326
00327
00328 typedef sigc::signal<void, std::string const&, HLTPathStatus const&> PostPathEndLumi;
00329 PostPathEndLumi postPathEndLumiSignal_;
00330 void watchPostPathEndLumi(PostPathEndLumi::slot_type const& iSlot) {
00331 PostPathEndLumi::slot_list_type sl = postPathEndLumiSignal_.slots();
00332 sl.push_front(iSlot);
00333 }
00334 AR_WATCH_USING_METHOD_2(watchPostPathEndLumi)
00335
00336
00337 typedef sigc::signal<void, ModuleDescription const&> PreModuleConstruction;
00338 PreModuleConstruction preModuleConstructionSignal_;
00339 void watchPreModuleConstruction(PreModuleConstruction::slot_type const& iSlot) {
00340 preModuleConstructionSignal_.connect(iSlot);
00341 }
00342 AR_WATCH_USING_METHOD_1(watchPreModuleConstruction)
00343
00344
00345 typedef sigc::signal<void, ModuleDescription const&> PostModuleConstruction;
00346 PostModuleConstruction postModuleConstructionSignal_;
00347 void watchPostModuleConstruction(PostModuleConstruction::slot_type const& iSlot) {
00348 PostModuleConstruction::slot_list_type sl = postModuleConstructionSignal_.slots();
00349 sl.push_front(iSlot);
00350 }
00351 AR_WATCH_USING_METHOD_1(watchPostModuleConstruction)
00352
00353
00354 typedef sigc::signal<void, ModuleDescription const&> PreModuleBeginJob;
00355 PreModuleBeginJob preModuleBeginJobSignal_;
00356 void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const& iSlot) {
00357 preModuleBeginJobSignal_.connect(iSlot);
00358 }
00359 AR_WATCH_USING_METHOD_1(watchPreModuleBeginJob)
00360
00361
00362 typedef sigc::signal<void, ModuleDescription const&> PostModuleBeginJob;
00363 PostModuleBeginJob postModuleBeginJobSignal_;
00364 void watchPostModuleBeginJob(PostModuleBeginJob::slot_type const& iSlot) {
00365 PostModuleBeginJob::slot_list_type sl = postModuleBeginJobSignal_.slots();
00366 sl.push_front(iSlot);
00367 }
00368 AR_WATCH_USING_METHOD_1(watchPostModuleBeginJob)
00369
00370
00371 typedef sigc::signal<void, ModuleDescription const&> PreModuleEndJob;
00372 PreModuleEndJob preModuleEndJobSignal_;
00373 void watchPreModuleEndJob(PreModuleEndJob::slot_type const& iSlot) {
00374 preModuleEndJobSignal_.connect(iSlot);
00375 }
00376 AR_WATCH_USING_METHOD_1(watchPreModuleEndJob)
00377
00378
00379 typedef sigc::signal<void, ModuleDescription const&> PostModuleEndJob;
00380 PostModuleEndJob postModuleEndJobSignal_;
00381 void watchPostModuleEndJob(PostModuleEndJob::slot_type const& iSlot) {
00382 PostModuleEndJob::slot_list_type sl = postModuleEndJobSignal_.slots();
00383 sl.push_front(iSlot);
00384 }
00385 AR_WATCH_USING_METHOD_1(watchPostModuleEndJob)
00386
00387
00388 typedef sigc::signal<void, ModuleDescription const&> PreModule;
00389 PreModule preModuleSignal_;
00390 void watchPreModule(PreModule::slot_type const& iSlot) {
00391 preModuleSignal_.connect(iSlot);
00392 }
00393 AR_WATCH_USING_METHOD_1(watchPreModule)
00394
00395
00396 typedef sigc::signal<void, ModuleDescription const&> PostModule;
00397 PostModule postModuleSignal_;
00398 void watchPostModule(PostModule::slot_type const& iSlot) {
00399 PostModule::slot_list_type sl = postModuleSignal_.slots();
00400 sl.push_front(iSlot);
00401 }
00402 AR_WATCH_USING_METHOD_1(watchPostModule)
00403
00404
00405 typedef sigc::signal<void, ModuleDescription const&> PreModuleBeginRun;
00406 PreModuleBeginRun preModuleBeginRunSignal_;
00407 void watchPreModuleBeginRun(PreModuleBeginRun::slot_type const& iSlot) {
00408 preModuleBeginRunSignal_.connect(iSlot);
00409 }
00410 AR_WATCH_USING_METHOD_1(watchPreModuleBeginRun)
00411
00412
00413 typedef sigc::signal<void, ModuleDescription const&> PostModuleBeginRun;
00414 PostModuleBeginRun postModuleBeginRunSignal_;
00415 void watchPostModuleBeginRun(PostModuleBeginRun::slot_type const& iSlot) {
00416 PostModuleBeginRun::slot_list_type sl = postModuleBeginRunSignal_.slots();
00417 sl.push_front(iSlot);
00418 }
00419 AR_WATCH_USING_METHOD_1(watchPostModuleBeginRun)
00420
00421
00422 typedef sigc::signal<void, ModuleDescription const&> PreModuleEndRun;
00423 PreModuleEndRun preModuleEndRunSignal_;
00424 void watchPreModuleEndRun(PreModuleEndRun::slot_type const& iSlot) {
00425 preModuleEndRunSignal_.connect(iSlot);
00426 }
00427 AR_WATCH_USING_METHOD_1(watchPreModuleEndRun)
00428
00429
00430 typedef sigc::signal<void, ModuleDescription const&> PostModuleEndRun;
00431 PostModuleEndRun postModuleEndRunSignal_;
00432 void watchPostModuleEndRun(PostModuleEndRun::slot_type const& iSlot) {
00433 PostModuleEndRun::slot_list_type sl = postModuleEndRunSignal_.slots();
00434 sl.push_front(iSlot);
00435 }
00436 AR_WATCH_USING_METHOD_1(watchPostModuleEndRun)
00437
00438
00439 typedef sigc::signal<void, ModuleDescription const&> PreModuleBeginLumi;
00440 PreModuleBeginLumi preModuleBeginLumiSignal_;
00441 void watchPreModuleBeginLumi(PreModuleBeginLumi::slot_type const& iSlot) {
00442 preModuleBeginLumiSignal_.connect(iSlot);
00443 }
00444 AR_WATCH_USING_METHOD_1(watchPreModuleBeginLumi)
00445
00446
00447 typedef sigc::signal<void, ModuleDescription const&> PostModuleBeginLumi;
00448 PostModuleBeginLumi postModuleBeginLumiSignal_;
00449 void watchPostModuleBeginLumi(PostModuleBeginLumi::slot_type const& iSlot) {
00450 PostModuleBeginLumi::slot_list_type sl = postModuleBeginLumiSignal_.slots();
00451 sl.push_front(iSlot);
00452 }
00453 AR_WATCH_USING_METHOD_1(watchPostModuleBeginLumi)
00454
00455
00456 typedef sigc::signal<void, ModuleDescription const&> PreModuleEndLumi;
00457 PreModuleEndLumi preModuleEndLumiSignal_;
00458 void watchPreModuleEndLumi(PreModuleEndLumi::slot_type const& iSlot) {
00459 preModuleEndLumiSignal_.connect(iSlot);
00460 }
00461 AR_WATCH_USING_METHOD_1(watchPreModuleEndLumi)
00462
00463
00464 typedef sigc::signal<void, ModuleDescription const&> PostModuleEndLumi;
00465 PostModuleEndLumi postModuleEndLumiSignal_;
00466 void watchPostModuleEndLumi(PostModuleEndLumi::slot_type const& iSlot) {
00467 PostModuleEndLumi::slot_list_type sl = postModuleEndLumiSignal_.slots();
00468 sl.push_front(iSlot);
00469 }
00470 AR_WATCH_USING_METHOD_1(watchPostModuleEndLumi)
00471
00472
00473 typedef sigc::signal<void, ModuleDescription const&> PreSourceConstruction;
00474 PreSourceConstruction preSourceConstructionSignal_;
00475 void watchPreSourceConstruction(PreSourceConstruction::slot_type const& iSlot) {
00476 preSourceConstructionSignal_.connect(iSlot);
00477 }
00478 AR_WATCH_USING_METHOD_1(watchPreSourceConstruction)
00479
00480
00481 typedef sigc::signal<void, ModuleDescription const&> PostSourceConstruction;
00482 PostSourceConstruction postSourceConstructionSignal_;
00483 void watchPostSourceConstruction(PostSourceConstruction::slot_type const& iSlot) {
00484 PostSourceConstruction::slot_list_type sl = postSourceConstructionSignal_.slots();
00485 sl.push_front(iSlot);
00486 }
00487 AR_WATCH_USING_METHOD_1(watchPostSourceConstruction)
00488
00489
00490
00491 void connect(ActivityRegistry& iOther);
00492
00498 void copySlotsFrom(ActivityRegistry& iOther);
00499
00500 private:
00501 };
00502 }
00503 #undef AR_WATCH_USING_METHOD
00504 #endif