VTK
dox/Parallel/vtkSocketController.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSocketController.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00043 #ifndef __vtkSocketController_h
00044 #define __vtkSocketController_h
00045 
00046 #include "vtkMultiProcessController.h"
00047 
00048 class vtkSocketCommunicator;
00049 
00050 class VTK_PARALLEL_EXPORT vtkSocketController : public vtkMultiProcessController
00051 {
00052 public:
00053   static vtkSocketController *New();
00054   vtkTypeMacro(vtkSocketController,vtkMultiProcessController);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00060   virtual void Initialize(int* argc, char*** argv, int)
00061     { this->Initialize(argc,argv); }
00062   virtual void Initialize(int* argc, char*** argv); 
00063   virtual void Initialize()
00064     { this->Initialize(0,0); }
00066 
00068 
00069   void Finalize() {};
00070   void Finalize(int) {};
00072 
00074   void SingleMethodExecute() {};
00075   
00077   void MultipleMethodExecute() {};
00078 
00080   void CreateOutputWindow() {};
00081 
00083   virtual int WaitForConnection(int port);
00084 
00086   virtual void CloseConnection();
00087 
00089   virtual int ConnectTo(const char* hostName, int port );
00090 
00091   int GetSwapBytesInReceivedData();
00092 
00094   void SetCommunicator(vtkSocketCommunicator* comm);
00095 
00103   vtkMultiProcessController *CreateCompliantController();
00104 
00105 //BTX
00106 
00107   enum Consts {
00108     ENDIAN_TAG=1010580540,      // 0x3c3c3c3c
00109     IDTYPESIZE_TAG=1027423549,  // 0x3d3d3d3d
00110     VERSION_TAG=1044266558,     // 0x3e3e3e3e
00111     HASH_TAG=0x3f3f3f3f
00112   };
00113   
00114 //ETX
00115 
00116 protected:
00117 
00118   vtkSocketController();
00119   ~vtkSocketController();
00120 
00121   // Initialize only once, finialize on destruction.
00122   static int Initialized;
00123 private:
00124   vtkSocketController(const vtkSocketController&);  // Not implemented.
00125   void operator=(const vtkSocketController&);  // Not implemented.
00126 };
00127 
00128 
00129 #endif // __vtkSocketController_h