00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00032 #ifndef __vtkMPIMToNSocketConnection_h
00033 #define __vtkMPIMToNSocketConnection_h
00034
00035 #include "vtkObject.h"
00036 class vtkMultiProcessController;
00037 class vtkSocketCommunicator;
00038 class vtkMPIMToNSocketConnectionPortInformation;
00039 class vtkMPIMToNSocketConnectionInternals;
00040
00041 class VTK_EXPORT vtkMPIMToNSocketConnection : public vtkObject
00042 {
00043 public:
00044 static vtkMPIMToNSocketConnection* New();
00045 vtkTypeRevisionMacro(vtkMPIMToNSocketConnection,vtkObject);
00046 void PrintSelf(ostream& os, vtkIndent indent);
00047
00049
00050 void SetNumberOfConnections(int);
00051 vtkGetMacro(NumberOfConnections, int);
00053
00056 void SetupWaitForConnection();
00057
00060 void WaitForConnection();
00061
00063 void Connect();
00064
00066 void SetPortInformation(unsigned int processNumber, int portNumber, const char* hostName);
00067
00069
00070 vtkGetObjectMacro(SocketCommunicator, vtkSocketCommunicator);
00072
00074 void GetPortInformation(vtkMPIMToNSocketConnectionPortInformation*);
00075
00077
00079 vtkSetStringMacro(MachinesFileName);
00081
00083
00085 vtkSetMacro(PortNumber,int);
00087
00089 void SetMachineName(unsigned int idx, const char* name);
00090
00091 protected:
00092 void LoadMachinesFile();
00093 virtual void SetController(vtkMultiProcessController*);
00094 virtual void SetSocketCommunicator(vtkSocketCommunicator*);
00095 vtkMPIMToNSocketConnection();
00096 ~vtkMPIMToNSocketConnection();
00097 private:
00098 int PortNumber;
00099 int Socket;
00100 char* HostName;
00101 char* MachinesFileName;
00102 vtkSetStringMacro(HostName);
00103 int NumberOfConnections;
00104 vtkMPIMToNSocketConnectionInternals* Internals;
00105 vtkMultiProcessController *Controller;
00106 vtkSocketCommunicator* SocketCommunicator;
00107 vtkMPIMToNSocketConnection(const vtkMPIMToNSocketConnection&);
00108 void operator=(const vtkMPIMToNSocketConnection&);
00109 };
00110
00111 #endif