00001 // $Id: TGo4Slave.h 1001 2013-07-25 15:10:31Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4SLAVE_H 00015 #define TGO4SLAVE_H 00016 00017 #include "TGo4TaskOwner.h" 00018 00019 class TGo4Status; 00020 class TGo4TaskStatus; 00021 class TGo4Command; 00022 class TGo4ThreadHandler; 00023 class TMutex; 00027 class TGo4Slave : public TGo4TaskOwner { 00028 private: 00029 00034 Bool_t fbMainIsRunning; 00035 00036 protected: 00037 00044 virtual void UpdateStatus(TGo4TaskStatus* state); 00045 00046 00047 public: 00048 TGo4Slave(); 00049 00050 TGo4Slave(const char* name, Bool_t isserver=kTRUE, const char* serverhost="localhost", UInt_t negotport=5000); 00051 00052 virtual ~TGo4Slave(); 00053 00058 virtual void Start(); 00059 00064 virtual void Stop(); 00065 00071 virtual void KillMain(); 00072 00078 virtual void RestartMain(); 00079 00080 virtual void Terminate (Bool_t termapp=kTRUE); 00081 00082 virtual void TerminateFast (); 00083 00090 virtual TGo4TaskStatus* CreateStatus(); 00091 00092 Bool_t MainIsRunning() { return fbMainIsRunning; } 00093 00095 TGo4Command* NextCommand(); 00096 00098 void SendObject(TObject * obj, const char* receiver=0); 00099 00101 void SendStatus(TGo4Status * stat, const char* receiver=0); 00102 00103 00108 virtual Int_t Initialization(); 00109 00110 TGo4ThreadHandler* GetThreadHandler(); 00111 00113 void SendStatusBuffer(); 00114 00119 virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString& text); 00120 00127 void UpdateStatusBuffer(); 00128 00133 virtual void ExecuteString(const char* command); 00134 00135 }; 00136 #endif //TGO4SLAVE_H