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 =========================================================================*/
44 #ifndef vtkSocketController_h
45 #define vtkSocketController_h
46 
47 #include "vtkParallelCoreModule.h" // For export macro
49 
51 
52 class VTKPARALLELCORE_EXPORT vtkSocketController : public vtkMultiProcessController
53 {
54 public:
55  static vtkSocketController *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
63  virtual void Initialize(int* argc, char*** argv, int)
64  { this->Initialize(argc,argv); }
65  virtual void Initialize(int* argc, char*** argv);
66  virtual void Initialize()
67  { this->Initialize(0,0); }
68 
72  void Finalize() {}
73  void Finalize(int) {}
74 
79 
84 
89 
94  virtual int WaitForConnection(int port);
95 
100  virtual void CloseConnection();
101 
106  virtual int ConnectTo(const char* hostName, int port );
107 
108  int GetSwapBytesInReceivedData();
109 
113  void SetCommunicator(vtkSocketCommunicator* comm);
114 
124  vtkMultiProcessController *CreateCompliantController();
125 
126  enum Consts {
127  ENDIAN_TAG=1010580540, // 0x3c3c3c3c
128  IDTYPESIZE_TAG=1027423549, // 0x3d3d3d3d
129  VERSION_TAG=1044266558, // 0x3e3e3e3e
130  HASH_TAG=0x3f3f3f3f
131  };
132 
133 protected:
134 
137 
138  // Initialize only once, finialize on destruction.
139  static int Initialized;
140 private:
141  vtkSocketController(const vtkSocketController&) VTK_DELETE_FUNCTION;
142  void operator=(const vtkSocketController&) VTK_DELETE_FUNCTION;
143 };
144 
145 
146 #endif // vtkSocketController_h
Process communication using Sockets.
virtual void Initialize(int *argc, char ***argv, int)
This method is for initialiazing sockets.
virtual void Initialize()
Process communication using Sockets.
void Finalize(int)
This method is for cleaning up.
void MultipleMethodExecute()
Does not apply to sockets.
virtual void Initialize(int *vtkNotUsed(argc), char ***vtkNotUsed(argv))=0
This method is for setting up the processes.
a simple class to control print indentation
Definition: vtkIndent.h:39
void Finalize()
Does not apply to sockets.
void SingleMethodExecute()
Does not apply to sockets.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void CreateOutputWindow()
Does not apply to sockets.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Multiprocessing communication superclass.