GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisProxy.h
Go to the documentation of this file.
1 // $Id: TGo4AnalysisProxy.h 1597 2015-06-19 16:28:25Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4ANALYSISPROXY_H
15 #define TGO4ANALYSISPROXY_H
16 
17 #include "TGo4ServerProxy.h"
18 
19 #include "TObjArray.h"
20 
22 class TGo4AnalysisDummySlot;
23 class TFolder;
25 class TGo4Status;
26 class TGo4Display;
27 
28 enum EGo4ShellKind { Go4_sh = 0, Go4_rsh = 1, Go4_ssh = 2 };
31 
33  protected:
34  Bool_t fIsServer;
35  TGo4AnalysisDummySlot* fDummySlot;
37  TObjArray fxSubmittedProxy;
40  Bool_t fbAnalysisReady;
44  Int_t fActualRole;
45  TTimer* fxRefreshTimer;
48 
49  TGo4AnalysisObjectAccess* FindSubmittedProxy(const char* pathname, const char* objname);
51 
53 
54  void CallSlotUpdate();
55 
56  public:
57  TGo4AnalysisProxy(Bool_t isserver = kFALSE);
58  virtual ~TGo4AnalysisProxy();
59 
60  // proxy functionality
61 
62  virtual void Initialize(TGo4Slot* slot);
63  virtual void Finalize(TGo4Slot* slot);
64 
65  virtual Bool_t HasSublevels() const;
66 
67  virtual TGo4LevelIter* MakeIter();
68 
69  virtual TGo4Access* ProvideAccess(const char* name);
70 
71  virtual void WriteData(TGo4Slot* slot, TDirectory* dir, Bool_t onlyobjs);
72  virtual void ReadData(TGo4Slot* slot, TDirectory* dir);
73 
74  virtual const char* GetContainedObjectInfo();
75  virtual Int_t GetObjectKind() { return TGo4Access::kndFolder; }
76  virtual const char* GetContainedClassName() { return ClassName(); }
77  virtual TObject* GetAssignedObject() { return this; }
78 
79  virtual void Update(TGo4Slot* slot, Bool_t strong);
80 
81  // server proxy functionality
82 
83 
84  virtual Bool_t IsGo4Analysis() const { return kTRUE; }
85  virtual Bool_t IsAnalysisServer() const { return fIsServer; }
86 
87  virtual Bool_t IsConnected();
88  virtual Bool_t IsViewer();
89  virtual Bool_t IsController();
90  virtual Bool_t IsAdministrator();
91 
92  virtual Bool_t RefreshNamesList();
93  virtual Bool_t DelayedRefreshNamesList(Int_t delay_sec);
94 
95  virtual Bool_t CanSubmitObjects() { return IsConnected() && !IsViewer(); }
96  virtual void RequestAnalysisSettings();
97  virtual void SubmitAnalysisSettings();
98  virtual void CloseAnalysisSettings();
99 
100  virtual Bool_t IsAnalysisRunning() const { return fbAnalysisRunning; }
101  virtual void StartAnalysis();
102  virtual void StopAnalysis();
103 
104  virtual Bool_t RequestObjectStatus(const char* objectname, TGo4Slot* tgtslot);
105 
106  virtual void RequestEventStatus(const char* evname, Bool_t astree, TGo4Slot* tgtslot);
107 
108  virtual Bool_t UpdateAnalysisObject(const char* objectname, TObject* obj);
109 
110  virtual void ClearAllAnalysisObjects();
111  virtual void ClearAnalysisObject(const char* fullpath);
112 
113  virtual void RemoteTreeDraw(const char* treename,
114  const char* varexp,
115  const char* cutcond,
116  const char* hname);
117 
118  virtual void ChageObjectProtection(const char* fullpath, const char* flags);
119 
120  virtual void RemoveObjectFromAnalysis(const char* fullpath);
121 
122  virtual void ExecuteLine(const char* line);
123 
124  virtual void PrintDynListEntry(const char* fullpath);
125 
126  virtual void RemotePrintEvent(const char* evname,
127  Int_t evnumber,
128  Int_t subid,
129  Bool_t ishex,
130  Bool_t islong);
131 
132  virtual void LoadConfigFile(const char* fname);
133  virtual void SaveConfigFile(const char* fname);
134 
135  virtual void WriteAutoSave(const char* fname,
136  Int_t complevel,
137  Bool_t overwrite);
138 
139  virtual Bool_t NamesListReceived();
140 
141  // analysis proxy functionality
142 
144 
145  // communication with analysis functionality
146 
147  Int_t ConnectorPort();
148  Int_t GetRole();
149 
150  void ReceiveObject(TNamed* obj);
151  void ReceiveStatus(TGo4Status* status);
152  Bool_t SubmitProxy(TGo4AnalysisObjectAccess* proxy);
153 
155 
156  Bool_t LaunchAsClient(TString& launchcmd,
157  TString& killcmd,
158  Int_t shellkind, // Go4_sh = 0, Go4_rsh = 1, Go4_ssh = 2
159  Int_t konsole, // Go4_qt = 0, Go4_xterm = 1, Go4_konsole = 2
160  const char* name,
161  const char* remotehost,
162  const char* remotedir,
163  const char* remoteexe,
164  Int_t exe_kind = 0, // Go4_exe = 0, Go4_lib = 1
165  const char* exeargs = 0);
166 
167  static Bool_t LaunchAsServer(TString& launchcmd,
168  TString& killcmd,
169  Int_t shellkind, // Go4_sh = 0, Go4_rsh = 1, Go4_ssh = 2
170  Int_t konsole, // Go4_qt = 0, Go4_xterm = 1, Go4_konsole = 2
171  const char* name,
172  const char* remotehost,
173  Int_t remoteport, // needed for http server mode
174  const char* remotedir,
175  const char* remoteexe,
176  Int_t exe_kind = 0, // Go4_exe = 0, Go4_lib = 1
177  const char* exeargs = 0);
178 
179  Bool_t ConnectToServer(const char* remotehost,
180  Int_t remoteport,
181  Int_t ascontroller, // 0 - observer, 1 - controller, 2 - administrator
182  const char* accesspass);
183 
184  Bool_t WaitForConnection(Int_t seconds);
185 
186  void DisplayDeleted(TGo4Display* displ);
187 
188  void DisplayDisconnected(TGo4Display* displ);
189 
194  virtual void DisconnectAnalysis(Int_t waittime = 30, Bool_t servershutdown = kFALSE);
195 
196  virtual Bool_t HandleTimer(TTimer* timer);
197 
199  void SetDefaultReceiver(TGo4ObjectManager* rcv, const char* path);
200 
201 
203 };
204 
205 
206 
207 #endif
void DisplayDeleted(TGo4Display *displ)
virtual Bool_t RefreshNamesList()
virtual Bool_t DelayedRefreshNamesList(Int_t delay_sec)
virtual Bool_t HandleTimer(TTimer *timer)
TGo4AnalysisProxy(Bool_t isserver=kFALSE)
TGo4Slot * UpdateObjectSlot()
EGo4AnalysisCodeKind
virtual void LoadConfigFile(const char *fname)
ClassDef(TGo4AnalysisProxy, 1)
Bool_t LaunchAsClient(TString &launchcmd, TString &killcmd, Int_t shellkind, Int_t konsole, const char *name, const char *remotehost, const char *remotedir, const char *remoteexe, Int_t exe_kind=0, const char *exeargs=0)
void ReceiveStatus(TGo4Status *status)
virtual void RemoteTreeDraw(const char *treename, const char *varexp, const char *cutcond, const char *hname)
virtual void ClearAllAnalysisObjects()
virtual TObject * GetAssignedObject()
virtual void ClearAnalysisObject(const char *fullpath)
Bool_t SubmitProxy(TGo4AnalysisObjectAccess *proxy)
virtual void RequestEventStatus(const char *evname, Bool_t astree, TGo4Slot *tgtslot)
virtual Bool_t IsViewer()
virtual Bool_t IsAdministrator()
void AssignNewNamesList(TGo4AnalysisObjectNames *objnames)
virtual Bool_t IsController()
virtual Bool_t HasSublevels() const
TGo4AnalysisObjectNames * fAnalysisNames
virtual Bool_t IsAnalysisServer() const
virtual Bool_t IsAnalysisRunning() const
virtual void Update(TGo4Slot *slot, Bool_t strong)
virtual void RemotePrintEvent(const char *evname, Int_t evnumber, Int_t subid, Bool_t ishex, Bool_t islong)
Bool_t ConnectToServer(const char *remotehost, Int_t remoteport, Int_t ascontroller, const char *accesspass)
void SetDefaultReceiver(TGo4ObjectManager *rcv, const char *path)
virtual void RequestAnalysisSettings()
virtual Int_t GetObjectKind()
virtual Bool_t IsGo4Analysis() const
virtual void WriteAutoSave(const char *fname, Int_t complevel, Bool_t overwrite)
virtual Bool_t IsConnected()
virtual void Finalize(TGo4Slot *slot)
void ReceiveObject(TNamed *obj)
virtual Bool_t NamesListReceived()
void DisplayDisconnected(TGo4Display *displ)
virtual void RemoveObjectFromAnalysis(const char *fullpath)
virtual void WriteData(TGo4Slot *slot, TDirectory *dir, Bool_t onlyobjs)
virtual const char * GetContainedClassName()
TGo4AnalysisObjectAccess * fxDefaultProxy
virtual TGo4LevelIter * MakeIter()
virtual Int_t NumberOfWaitingProxyes()
TGo4AnalysisObjectAccess * FindSubmittedProxy(const char *pathname, const char *objname)
virtual const char * GetContainedObjectInfo()
virtual void SaveConfigFile(const char *fname)
virtual Bool_t CanSubmitObjects()
virtual void StartAnalysis()
EGo4ConsoleKind
virtual void CloseAnalysisSettings()
virtual Bool_t RequestObjectStatus(const char *objectname, TGo4Slot *tgtslot)
virtual void Initialize(TGo4Slot *slot)
virtual Bool_t UpdateAnalysisObject(const char *objectname, TObject *obj)
TObjArray fxSubmittedProxy
virtual void ChageObjectProtection(const char *fullpath, const char *flags)
virtual void ExecuteLine(const char *line)
virtual TGo4Access * ProvideAccess(const char *name)
EGo4ShellKind
virtual void SubmitAnalysisSettings()
Bool_t WaitForConnection(Int_t seconds)
virtual void PrintDynListEntry(const char *fullpath)
TGo4Display * fxDisplay
virtual void ReadData(TGo4Slot *slot, TDirectory *dir)
void DeleteSubmittedProxy(TGo4AnalysisObjectAccess *proxy)
virtual void DisconnectAnalysis(Int_t waittime=30, Bool_t servershutdown=kFALSE)
virtual void StopAnalysis()
TGo4AnalysisDummySlot * fDummySlot
static Bool_t LaunchAsServer(TString &launchcmd, TString &killcmd, Int_t shellkind, Int_t konsole, const char *name, const char *remotehost, Int_t remoteport, const char *remotedir, const char *remoteexe, Int_t exe_kind=0, const char *exeargs=0)