00001 // $Id: TGo4Slave.h 478 2009-10-29 12:26:09Z 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 public: 00029 TGo4Slave() ; 00030 00031 TGo4Slave(const char* name, Bool_t isserver=kTRUE, const char* serverhost="localhost", UInt_t negotport=5000) ; 00032 00033 virtual ~TGo4Slave() ; 00034 00039 virtual void Start(); 00040 00045 virtual void Stop(); 00046 00052 virtual void KillMain(); 00053 00059 virtual void RestartMain(); 00060 00061 virtual void Terminate (Bool_t termapp=kTRUE); 00062 00063 virtual void TerminateFast (); 00064 00071 virtual TGo4TaskStatus* CreateStatus(); 00072 00073 Bool_t MainIsRunning() { return fbMainIsRunning; } 00074 00076 TGo4Command* NextCommand(); 00077 00079 void SendObject(TObject * obj, const char* receiver=0); 00080 00082 void SendStatus(TGo4Status * stat, const char* receiver=0); 00083 00084 00089 virtual Int_t Initialization(); 00090 00091 TGo4ThreadHandler* GetThreadHandler(); 00092 00094 void SendStatusBuffer(); 00095 00100 void SendStatusMessage(Int_t level, Bool_t printout, const char* text, ...); 00101 00108 void UpdateStatusBuffer(); 00109 00114 virtual void ExecuteString(const char* command); 00115 00116 protected: 00117 00124 virtual void UpdateStatus(TGo4TaskStatus* state); 00125 00126 private: 00127 00132 Bool_t fbMainIsRunning; 00133 }; 00134 #endif //TGO4SLAVE_H