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
void connect(Observer< const BeginOfJob *> *iObject)
static void enroll(SimActivityRegistry &iReg, Observer< const T *> *iObs)
static void enroll(SimActivityRegistry &iReg, T *iT)
static void enroll(SimActivityRegistry &iReg, T *iObj)
const SimActivityRegistryEnroller & operator=(const SimActivityRegistryEnroller &)=delete
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
long double T
static void enroll(SimActivityRegistry &, void *)