VTK
dox/Parallel/Core/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 "vtkParallelCoreModule.h" // For export macro
00047 #include "vtkMultiProcessController.h"
00048 
00049 class vtkSocketCommunicator;
00050 
00051 class VTKPARALLELCORE_EXPORT vtkSocketController : public vtkMultiProcessController
00052 {
00053 public:
00054   static vtkSocketController *New();
00055   vtkTypeMacro(vtkSocketController,vtkMultiProcessController);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00061   virtual void Initialize(int* argc, char*** argv, int)
00062     { this->Initialize(argc,argv); }
00063   virtual void Initialize(int* argc, char*** argv);
00064   virtual void Initialize()
00065     { this->Initialize(0,0); }
00067 
00069 
00070   void Finalize() {}
00071   void Finalize(int) {}
00073 
00075   void SingleMethodExecute() {}
00076 
00078   void MultipleMethodExecute() {}
00079 
00081   void CreateOutputWindow() {}
00082 
00084   virtual int WaitForConnection(int port);
00085 
00087   virtual void CloseConnection();
00088 
00090   virtual int ConnectTo(const char* hostName, int port );
00091 
00092   int GetSwapBytesInReceivedData();
00093 
00095   void SetCommunicator(vtkSocketCommunicator* comm);
00096 
00104   vtkMultiProcessController *CreateCompliantController();
00105 
00106 //BTX
00107 
00108   enum Consts {
00109     ENDIAN_TAG=1010580540,      // 0x3c3c3c3c
00110     IDTYPESIZE_TAG=1027423549,  // 0x3d3d3d3d
00111     VERSION_TAG=1044266558,     // 0x3e3e3e3e
00112     HASH_TAG=0x3f3f3f3f
00113   };
00114 
00115 //ETX
00116 
00117 protected:
00118 
00119   vtkSocketController();
00120   ~vtkSocketController();
00121 
00122   // Initialize only once, finialize on destruction.
00123   static int Initialized;
00124 private:
00125   vtkSocketController(const vtkSocketController&);  // Not implemented.
00126   void operator=(const vtkSocketController&);  // Not implemented.
00127 };
00128 
00129 
00130 #endif // __vtkSocketController_h