Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkSocketController.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSocketController.h,v $
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 =========================================================================*/
00042 #ifndef __vtkSocketController_h
00043 #define __vtkSocketController_h
00044 
00045 #include "vtkMultiProcessController.h"
00046 
00047 class vtkSocketCommunicator;
00048 
00049 class VTK_PARALLEL_EXPORT vtkSocketController : public vtkMultiProcessController
00050 {
00051 public:
00052   static vtkSocketController *New();
00053   vtkTypeRevisionMacro(vtkSocketController,vtkMultiProcessController);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057 
00059   virtual void Initialize(int* argc, char*** argv, int)
00060     { this->Initialize(argc,argv); }
00061   virtual void Initialize(int* argc, char*** argv); 
00062   virtual void Initialize()
00063     { this->Initialize(0,0); }
00065 
00067 
00068   void Finalize() {};
00069   void Finalize(int) {};
00071 
00073   void SingleMethodExecute() {};
00074   
00076   void MultipleMethodExecute() {};
00077 
00079   void CreateOutputWindow() {};
00080 
00082   void Barrier() {};
00083 
00085   virtual void SetNumberOfProcesses(int num);
00086 
00088   virtual int WaitForConnection(int port);
00089 
00091   virtual void CloseConnection();
00092 
00094   virtual int ConnectTo( char* hostName, int port );
00095 
00096   int GetSwapBytesInReceivedData();
00097 
00099   void SetCommunicator(vtkSocketCommunicator* comm);
00100 
00101 //BTX
00102 
00103   enum Consts {
00104     ENDIAN_TAG=1010580540 // 0x3c3c3c3c
00105   };
00106 
00107 //ETX
00108 
00109 protected:
00110 
00111   vtkSocketController();
00112   ~vtkSocketController();
00113 
00114   // Initialize only once, finialize on destruction.
00115   static int Initialized;
00116 private:
00117   vtkSocketController(const vtkSocketController&);  // Not implemented.
00118   void operator=(const vtkSocketController&);  // Not implemented.
00119 };
00120 
00121 
00122 #endif // __vtkSocketController_h