00001 // $Id: TGo4CommandInvoker.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 TGO4COMMANDINVOKER_H 00015 #define TGO4COMMANDINVOKER_H 00016 00022 #include "TObject.h" 00023 #include "TGo4CommandReceiver.h" 00024 00025 class TMutex; 00026 class TObjArray; 00027 class TGo4Command; 00028 class TGo4RemoteCommand; 00029 class TGo4CommandProtoList; 00030 00037 class TGo4CommandInvoker : public TObject, public TGo4CommandReceiver { 00038 00039 public: 00040 00041 static TGo4CommandInvoker * Instance(); 00042 00043 static void Register(const char* name, TGo4CommandReceiver *p); 00044 00045 static void UnRegister(TGo4CommandReceiver* p); 00046 00047 virtual void Invoke(TGo4Command * com); 00048 00049 virtual void Invoke(); 00050 00051 virtual ~TGo4CommandInvoker(); 00052 00055 static void SetCommandList(TGo4CommandProtoList* list); 00056 00059 Int_t ExecuteFromRemote(TGo4RemoteCommand* remcom); 00060 00061 protected: 00062 00063 TGo4CommandInvoker(); 00064 00065 static TGo4CommandReceiver * Lookup(const char* name); 00066 00067 private: 00068 00070 TGo4Command * fxCommand; 00071 00074 static TGo4CommandProtoList* fxCommandList; 00075 00076 static TGo4CommandInvoker *fxInstance; 00077 static TObjArray * fxArray; 00078 static TMutex * fxMutex; 00079 ClassDef(TGo4CommandInvoker, 2) 00080 }; 00081 00082 #endif //TGO4COMMANDINVOKER_H