00001 // ===================================================================== 00002 // $Id: TEventManager.hh,v 1.2 2003/06/30 03:44:07 goiwai Exp $ 00003 // $Name: CLDAQ-1-06-00 $ 00004 // ===================================================================== 00005 #ifndef __TEVENTMANAGER_HH 00006 #define __TEVENTMANAGER_HH 00007 00008 #include "Tglobals.h" 00009 #include "TEvent.hh" 00010 //#include "TSystemTimer.hh" 00011 00012 class TRun; 00013 class TEventAction; 00014 00015 class TEventManager 00016 { 00017 00018 private: 00019 static TEventManager* theEventManager; 00020 00021 public: 00022 enum { tDefaultStackSize = 100 }; 00023 00024 private: 00025 Tstatus_t theStatus; 00026 Tint theStackSize; 00027 Tint theNumberOfEvents; 00028 TEventAction* theEventAction; 00029 TEvent theEvent; 00030 //TSystemTimer theEventTimer; 00031 00032 public: 00033 TEventManager( Tint stacksize = tDefaultStackSize ); 00034 virtual ~TEventManager(); 00035 00036 public: 00037 Tint GetStackSize() const; 00038 Tint GetNumberOfEvents() const; 00039 const TEvent& GetEvent() const; 00040 TEvent& GetEvent(); 00041 TEventAction* GetEventAction() const; 00042 Tvoid SetStackSize( Tint stacksize ); 00043 Tvoid SetNumberOfEvents( Tint nevents ); 00044 Tvoid SetEvent( const TEvent& event ); 00045 Tvoid SetEventAction( TEventAction* action ); 00046 Tstatus_t GetStatus() const; 00047 Tvoid SetStatus( Tstatus_t status ); 00048 //const TSystemTimer& GetEventTimer() const; 00049 //TSystemTimer& GetEventTimer(); 00050 //Tvoid SetEventTimer( const TSystemTimer& timer ); 00051 00052 public: 00053 virtual const TRun& RecordEvent(); 00054 virtual const TEvent& TakeEvent(); 00055 virtual Tvoid ShowStatus() const; 00056 virtual Tvoid Clear(); 00057 00058 public: 00059 static TEventManager* GetEventManager(); 00060 00061 }; 00062 00063 inline TEventManager* TEventManager::GetEventManager() 00064 { 00065 return( theEventManager ); 00066 } 00067 00068 inline Tint TEventManager::GetStackSize() const 00069 { 00070 return( theStackSize ); 00071 } 00072 00073 inline Tint TEventManager::GetNumberOfEvents() const 00074 { 00075 return( theNumberOfEvents ); 00076 } 00077 00078 inline const TEvent& TEventManager::GetEvent() const 00079 { 00080 return( theEvent ); 00081 } 00082 00083 inline TEvent& TEventManager::GetEvent() 00084 { 00085 return( theEvent ); 00086 } 00087 00088 inline TEventAction* TEventManager::GetEventAction() const 00089 { 00090 return( theEventAction ); 00091 } 00092 00093 inline Tvoid TEventManager::SetNumberOfEvents( Tint nevents ) 00094 { 00095 theNumberOfEvents = nevents; 00096 return; 00097 } 00098 00099 inline Tvoid TEventManager::SetEvent( const TEvent& event ) 00100 { 00101 theEvent = event; 00102 return; 00103 } 00104 00105 inline Tstatus_t TEventManager::GetStatus() const 00106 { 00107 return( theStatus ); 00108 } 00109 00110 inline Tvoid TEventManager::SetStatus( Tstatus_t status ) 00111 { 00112 theStatus = status; 00113 return; 00114 } 00115 00116 // inline const TSystemTimer& TEventManager::GetEventTimer() const 00117 // { 00118 // return( theEventTimer ); 00119 // } 00120 00121 // inline TSystemTimer& TEventManager::GetEventTimer() 00122 // { 00123 // return( theEventTimer ); 00124 // } 00125 00126 // inline Tvoid TEventManager::SetEventTimer( const TSystemTimer& timer ) 00127 // { 00128 // theEventTimer = timer; 00129 // return; 00130 // } 00131 00132 #endif