CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: SimActivityRegistry.h,v 1.6 2007/10/24 17:16:51 chrjones Exp $
20 //
21 
22 // system include files
23 #include "boost/bind.hpp"
24 #include "boost/mem_fn.hpp"
25 
26 // user include files
28 
29 
30 // forward declarations
31 class BeginOfJob;
32 class BeginOfRun;
33 class BeginOfEvent;
34 class BeginOfTrack;
35 class BeginOfStep;
36 class EndOfRun;
37 class EndOfEvent;
38 class EndOfTrack;
39 class DDDWorld;
40 class G4Step;
41 
42 #define SAR_CONNECT_METHOD(signal) void connect(Observer<const signal*>* iObject) { watch ## signal (iObject); }
43 
45 {
46 
47  public:
49  //virtual ~SimActivityRegistry();
50 
55  }
57 
58  typedef sim_act::Signaler<DDDWorld> DDDWorldSignal;
59  DDDWorldSignal dddWorldSignal_;
60  void watchDDDWorld(const DDDWorldSignal::slot_type& iSlot){
61  dddWorldSignal_.connect(iSlot);
62  }
64 
66  BeginOfRunSignal beginOfRunSignal_;
67  void watchBeginOfRun(const BeginOfRunSignal::slot_type& iSlot){
68  beginOfRunSignal_.connect(iSlot);
69  }
71 
73  BeginOfEventSignal beginOfEventSignal_;
74  void watchBeginOfEvent(const BeginOfEventSignal::slot_type& iSlot){
75  beginOfEventSignal_.connect(iSlot);
76  }
78 
80  BeginOfTrackSignal beginOfTrackSignal_;
81  void watchBeginOfTrack(const BeginOfTrackSignal::slot_type& iSlot){
82  beginOfTrackSignal_.connect(iSlot);
83  }
85 
86  typedef sim_act::Signaler<G4Step> G4StepSignal;
87  G4StepSignal g4StepSignal_;
88  void watchG4Step(const G4StepSignal::slot_type& iSlot){
89  g4StepSignal_.connect(iSlot);
90  }
91  SAR_CONNECT_METHOD(G4Step)
92 
93  typedef sim_act::Signaler<EndOfRun> EndOfRunSignal;
94  EndOfRunSignal endOfRunSignal_;
95  void watchEndOfRun(const EndOfRunSignal::slot_type& iSlot){
96  endOfRunSignal_.connect(iSlot);
97  }
99 
101  EndOfEventSignal endOfEventSignal_;
102  void watchEndOfEvent(const EndOfEventSignal::slot_type& iSlot){
103  endOfEventSignal_.connect(iSlot);
104  }
106 
108  EndOfTrackSignal endOfTrackSignal_;
109  void watchEndOfTrack(const EndOfTrackSignal::slot_type& iSlot){
110  endOfTrackSignal_.connect(iSlot);
111  }
113 
114 
115  void connect(SimActivityRegistry& iOther);
116 
117  private:
119 
120  const SimActivityRegistry& operator=(const SimActivityRegistry&); // stop default
121 
122  // ---------- member data --------------------------------
123 
124 };
125 
126 
127 #endif
void watchEndOfEvent(const EndOfEventSignal::slot_type &iSlot)
void watchEndOfTrack(const EndOfTrackSignal::slot_type &iSlot)
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:60
void watchG4Step(const G4StepSignal::slot_type &iSlot)
DDDWorldSignal dddWorldSignal_
void watchBeginOfTrack(const BeginOfTrackSignal::slot_type &iSlot)
string const
Definition: compareJSON.py:14
#define private
Definition: FWFileEntry.h:18
void watchDDDWorld(const DDDWorldSignal::slot_type &iSlot)
void connect(SimActivityRegistry &iOther)
forwards our signals to slots connected to iOther
EndOfTrackSignal endOfTrackSignal_
BeginOfTrackSignal beginOfTrackSignal_