CMS 3D CMS Logo

SimActivityRegistryEnroller.h
Go to the documentation of this file.
1 #ifndef Notification_SimActivityRegistryEnroller_h
2 #define Notification_SimActivityRegistryEnroller_h
3 // -*- C++ -*-
4 //
5 // Package: Notification
6 // Class : SimActivityRegistryEnroller
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sun Nov 13 15:08:12 EST 2005
19 //
20 // user include files
23 
24 // forward declarations
25 namespace enroller_helper {
26  template <class T>
27  struct Enrollment {
28  static void enroll(SimActivityRegistry& iReg, Observer<const T*>* iObs) { iReg.connect(iObs); }
29  static void enroll(SimActivityRegistry&, void*) {}
30  };
31 
32  template <class T>
33  static void enroll(SimActivityRegistry& iReg, T* iT) {}
34 
35  template <class T, class F, class... TVector>
36  static void enroll(SimActivityRegistry& iReg, T* iT) {
37  //Try to enroll the object if it inherits from the class at the
38  // start of TVector
39  Enrollment<F>::enroll(iReg, iT);
40  enroll<T, TVector...>(iReg, iT);
41  }
42 
43 } // namespace enroller_helper
44 
46 public:
48 
49  template <class T>
50  static void enroll(SimActivityRegistry& iReg, T* iObj) {
52  BeginOfJob,
53  DDDWorld,
54  BeginOfRun,
57  BeginOfStep,
58  G4Step,
59  EndOfTrack,
60  EndOfEvent,
61  EndOfRun>(iReg, iObj);
62  }
63 
64  // stop default
67 };
68 
69 #endif
enroller_helper
Definition: SimActivityRegistryEnroller.h:25
Observer< const T * >
DDDWorld
Definition: DDDWorld.h:14
SimActivityRegistryEnroller::operator=
const SimActivityRegistryEnroller & operator=(const SimActivityRegistryEnroller &)=delete
EndOfTrack
Definition: EndOfTrack.h:6
Observer.h
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
SimActivityRegistryEnroller
Definition: SimActivityRegistryEnroller.h:45
SimActivityRegistry.h
SimActivityRegistryEnroller::SimActivityRegistryEnroller
SimActivityRegistryEnroller()
Definition: SimActivityRegistryEnroller.h:47
enroller_helper::Enrollment::enroll
static void enroll(SimActivityRegistry &, void *)
Definition: SimActivityRegistryEnroller.h:29
BeginOfTrack
Definition: BeginOfTrack.h:6
BeginOfJob
Definition: BeginOfJob.h:8
EndOfEvent
Definition: EndOfEvent.h:6
enroller_helper::Enrollment::enroll
static void enroll(SimActivityRegistry &iReg, Observer< const T * > *iObs)
Definition: SimActivityRegistryEnroller.h:28
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition: SimActivityRegistryEnroller.h:50
enroller_helper::enroll
static void enroll(SimActivityRegistry &iReg, T *iT)
Definition: SimActivityRegistryEnroller.h:33
BeginOfEvent
Definition: BeginOfEvent.h:6
BeginOfRun
Definition: BeginOfRun.h:6
EndOfRun
Definition: EndOfRun.h:6
SimActivityRegistry
Definition: SimActivityRegistry.h:39
T
long double T
Definition: Basic3DVectorLD.h:48
SimActivityRegistry::connect
void connect(Observer< const BeginOfJob * > *iObject)
Definition: SimActivityRegistry.h:47
enroller_helper::Enrollment
Definition: SimActivityRegistryEnroller.h:27