00001 // $Id: TGo4TaskOwner.h 615 2010-04-14 15:34:12Z adamczew $ 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 TGO4TASKOWNER_H 00015 #define TGO4TASKOWNER_H 00016 00017 #include "TGo4CommandReceiver.h" 00018 00019 class TMutex; 00020 class TGo4Task; 00021 class TGo4ServerTask; 00022 00027 class TGo4TaskOwner : public TGo4CommandReceiver { 00028 friend class TGo4Task; 00029 friend class TGo4ServerTask; 00030 00031 public: 00032 00033 TGo4TaskOwner(); 00034 00035 TGo4TaskOwner(Bool_t isserver); 00036 00037 virtual ~TGo4TaskOwner(); 00038 00039 Bool_t IsServer() { return fbServerMode; } 00040 00041 TGo4Task* GetTask() { return fxTask; } 00042 00046 virtual Int_t StartWorkThreads(); 00047 00051 virtual Int_t StopWorkThreads(); 00052 00057 virtual void Quit(); 00058 00059 const char* GetName() const; 00060 00061 Bool_t IsConnected(); 00062 00063 Bool_t IsBeingQuit(); 00064 00066 TMutex* GetTaskManagerMutex(); 00067 00068 00069 protected: 00070 00071 void SetTask(TGo4Task* task, Bool_t delold=kTRUE); 00072 00073 private: 00074 00078 TGo4Task* fxTask; 00079 00081 Bool_t fbServerMode; 00082 }; 00083 00084 #endif //TGO4TASKOWNER_H