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 
47 
49 
51 {
52 public:
53  static vtkSocketController *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
60  virtual void Initialize(int* argc, char*** argv, int)
61  { this->Initialize(argc,argv); }
62  virtual void Initialize(int* argc, char*** argv);
63  virtual void Initialize()
64  { this->Initialize(0,0); }
66 
68 
69  void Finalize() {};
70  void Finalize(int) {};
72 
75 
78 
80  void CreateOutputWindow() {};
81 
83  virtual int WaitForConnection(int port);
84 
86  virtual void CloseConnection();
87 
89  virtual int ConnectTo(const char* hostName, int port );
90 
91  int GetSwapBytesInReceivedData();
92 
94  void SetCommunicator(vtkSocketCommunicator* comm);
95 
103  vtkMultiProcessController *CreateCompliantController();
104 
105 //BTX
106 
107  enum Consts {
108  ENDIAN_TAG=1010580540, // 0x3c3c3c3c
109  IDTYPESIZE_TAG=1027423549, // 0x3d3d3d3d
110  VERSION_TAG=1044266558, // 0x3e3e3e3e
111  HASH_TAG=0x3f3f3f3f
112  };
113 
114 //ETX
115 
116 protected:
117 
120 
121  // Initialize only once, finialize on destruction.
122  static int Initialized;
123 private:
124  vtkSocketController(const vtkSocketController&); // Not implemented.
125  void operator=(const vtkSocketController&); // Not implemented.
126 };
127 
128 
129 #endif // __vtkSocketController_h
Process communication using Sockets.
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:37
#define VTK_PARALLEL_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
Multiprocessing communication superclass.