CMS 3D CMS Logo

SimActivityRegistry.h
Go to the documentation of this file.
1 #ifndef SimG4Core_Notification_SimActivityRegistry_h
2 #define SimG4Core_Notification_SimActivityRegistry_h
3 // -*- C++ -*-
4 //
5 // Package: Notification
6 // Class : SimActivityRegistry
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sun Nov 13 11:43:40 EST 2005
19 //
20 
21 // system include files
22 #include "boost/bind.hpp"
23 #include "boost/mem_fn.hpp"
24 
25 // user include files
27 
28 // forward declarations
29 class BeginOfJob;
30 class BeginOfRun;
31 class BeginOfEvent;
32 class BeginOfTrack;
33 class BeginOfStep;
34 class EndOfRun;
35 class EndOfEvent;
36 class EndOfTrack;
37 class DDDWorld;
38 class G4Step;
39 
40 #define SAR_CONNECT_METHOD(signal) \
41  void connect(Observer<const signal*>* iObject) { watch##signal(iObject); }
42 
44 public:
46  //virtual ~SimActivityRegistry();
47 
49  BeginOfJobSignal beginOfJobSignal_;
50  void watchBeginOfJob(const BeginOfJobSignal::slot_type& iSlot) { beginOfJobSignal_.connect(iSlot); }
52 
54  DDDWorldSignal dddWorldSignal_;
55  void watchDDDWorld(const DDDWorldSignal::slot_type& iSlot) { dddWorldSignal_.connect(iSlot); }
57 
59  BeginOfRunSignal beginOfRunSignal_;
60  void watchBeginOfRun(const BeginOfRunSignal::slot_type& iSlot) { beginOfRunSignal_.connect(iSlot); }
62 
64  BeginOfEventSignal beginOfEventSignal_;
65  void watchBeginOfEvent(const BeginOfEventSignal::slot_type& iSlot) { beginOfEventSignal_.connect(iSlot); }
67 
69  BeginOfTrackSignal beginOfTrackSignal_;
70  void watchBeginOfTrack(const BeginOfTrackSignal::slot_type& iSlot) { beginOfTrackSignal_.connect(iSlot); }
72 
73  typedef sim_act::Signaler<G4Step> G4StepSignal;
74  G4StepSignal g4StepSignal_;
75  void watchG4Step(const G4StepSignal::slot_type& iSlot) { g4StepSignal_.connect(iSlot); }
77 
79  EndOfRunSignal endOfRunSignal_;
80  void watchEndOfRun(const EndOfRunSignal::slot_type& iSlot) { endOfRunSignal_.connect(iSlot); }
82 
84  EndOfEventSignal endOfEventSignal_;
85  void watchEndOfEvent(const EndOfEventSignal::slot_type& iSlot) { endOfEventSignal_.connect(iSlot); }
87 
89  EndOfTrackSignal endOfTrackSignal_;
90  void watchEndOfTrack(const EndOfTrackSignal::slot_type& iSlot) { endOfTrackSignal_.connect(iSlot); }
92 
93 
94  void connect(SimActivityRegistry& iOther);
95 
96 private:
97  SimActivityRegistry(const SimActivityRegistry&) = delete; // stop default
98 
99  const SimActivityRegistry& operator=(const SimActivityRegistry&) = delete; // stop default
100 
101  // ---------- member data --------------------------------
102 };
103 
104 #endif
void watchEndOfEvent(const EndOfEventSignal::slot_type &iSlot)
void watchEndOfTrack(const EndOfTrackSignal::slot_type &iSlot)
void connect(Observer< const BeginOfJob * > *iObject)
EndOfEventSignal endOfEventSignal_
BeginOfRunSignal beginOfRunSignal_
#define SAR_CONNECT_METHOD(signal)
BeginOfJobSignal beginOfJobSignal_
void watchBeginOfJob(const BeginOfJobSignal::slot_type &iSlot)
void watchBeginOfRun(const BeginOfRunSignal::slot_type &iSlot)
void watchEndOfRun(const EndOfRunSignal::slot_type &iSlot)
sim_act::Signaler< BeginOfJob > BeginOfJobSignal
BeginOfEventSignal beginOfEventSignal_
void watchBeginOfEvent(const BeginOfEventSignal::slot_type &iSlot)
EndOfRunSignal endOfRunSignal_
void connect(Observer< const T * > *iObs)
does not take ownership of memory
Definition: Signaler.h:55
void watchG4Step(const G4StepSignal::slot_type &iSlot)
DDDWorldSignal dddWorldSignal_
void watchBeginOfTrack(const BeginOfTrackSignal::slot_type &iSlot)
void watchDDDWorld(const DDDWorldSignal::slot_type &iSlot)
EndOfTrackSignal endOfTrackSignal_
BeginOfTrackSignal beginOfTrackSignal_