00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00020 #ifndef __vtkKWRemoteExecute_h
00021 #define __vtkKWRemoteExecute_h
00022
00023 #include "vtkObject.h"
00024
00025 class vtkMultiThreader;
00026
00027 class vtkKWRemoteExecuteInternal;
00028
00029 class VTK_EXPORT vtkKWRemoteExecute : public vtkObject
00030 {
00031 public:
00032 static vtkKWRemoteExecute* New();
00033 vtkTypeRevisionMacro(vtkKWRemoteExecute,vtkObject);
00034 void PrintSelf(ostream& os, vtkIndent indent);
00035
00036
00038 int RunRemoteCommand(const char* args);
00039
00041 int RunCommand(const char* args);
00042
00043 static void* RunCommandThread(void*);
00044
00045 enum {
00046 NOT_RUN,
00047 RUNNING,
00048 SUCCESS,
00049 FAIL
00050 };
00051
00052
00054 int WaitToFinish();
00055
00059 static int Detach();
00060
00062
00063 vtkSetStringMacro(RemoteHost);
00064 vtkGetStringMacro(RemoteHost);
00066
00068
00069 vtkGetMacro(Result, int);
00071
00073
00074 vtkSetStringMacro(SSHUser);
00075 vtkGetStringMacro(SSHUser);
00077
00079
00080 vtkSetStringMacro(SSHCommand);
00081 vtkGetStringMacro(SSHCommand);
00083
00085
00086 vtkSetStringMacro(SSHArguments);
00087 vtkGetStringMacro(SSHArguments);
00089
00090 protected:
00091 vtkKWRemoteExecute();
00092 ~vtkKWRemoteExecute();
00093
00094 vtkKWRemoteExecuteInternal* Internals;
00095 vtkMultiThreader* MultiThreader;
00096
00097 char* SSHCommand;
00098 char* SSHArguments;
00099 char* SSHUser;
00100 char* RemoteHost;
00101 int ProcessRunning;
00102 int Result;
00103
00104 int ProcessThreadId;
00105
00106 private:
00107 vtkKWRemoteExecute(const vtkKWRemoteExecute&);
00108 void operator=(const vtkKWRemoteExecute&);
00109 };
00110
00111
00112 #endif
00113
00114
00115
00116
00117