VTK
vtkSocketController.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSocketController.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
43 #ifndef vtkSocketController_h
44 #define vtkSocketController_h
45 
46 #include "vtkParallelCoreModule.h" // For export macro
48 
50 
52 {
53 public:
54  static vtkSocketController *New();
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
61  virtual void Initialize(int* argc, char*** argv, int)
62  { this->Initialize(argc,argv); }
63  virtual void Initialize(int* argc, char*** argv);
64  virtual void Initialize()
65  { this->Initialize(0,0); }
67 
69 
70  void Finalize() {}
71  void Finalize(int) {}
73 
76 
79 
82 
84  virtual int WaitForConnection(int port);
85 
87  virtual void CloseConnection();
88 
90  virtual int ConnectTo(const char* hostName, int port );
91 
92  int GetSwapBytesInReceivedData();
93 
95  void SetCommunicator(vtkSocketCommunicator* comm);
96 
104  vtkMultiProcessController *CreateCompliantController();
105 
106 //BTX
107 
108  enum Consts {
109  ENDIAN_TAG=1010580540, // 0x3c3c3c3c
110  IDTYPESIZE_TAG=1027423549, // 0x3d3d3d3d
111  VERSION_TAG=1044266558, // 0x3e3e3e3e
112  HASH_TAG=0x3f3f3f3f
113  };
114 
115 //ETX
116 
117 protected:
118 
121 
122  // Initialize only once, finialize on destruction.
123  static int Initialized;
124 private:
125  vtkSocketController(const vtkSocketController&); // Not implemented.
126  void operator=(const vtkSocketController&); // Not implemented.
127 };
128 
129 
130 #endif // vtkSocketController_h
Process communication using Sockets.
#define VTKPARALLELCORE_EXPORT
virtual void Initialize(int *argc, char ***argv, int)
virtual void Initialize()
Process communication using Sockets.
virtual void Initialize(int *vtkNotUsed(argc), char ***vtkNotUsed(argv))=0
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
Multiprocessing communication superclass.