VTK  9.2.20230322
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 
48 #include "vtkParallelCoreModule.h" // For export macro
49 
50 VTK_ABI_NAMESPACE_BEGIN
52 
53 class VTKPARALLELCORE_EXPORT vtkSocketController : public vtkMultiProcessController
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
64  void Initialize(int* argc, char*** argv, int) override { this->Initialize(argc, argv); }
65  void Initialize(int* argc, char*** argv) override;
66  virtual void Initialize() { this->Initialize(nullptr, nullptr); }
67 
71  void Finalize() override {}
72  void Finalize(int) override {}
73 
77  void SingleMethodExecute() override {}
78 
82  void MultipleMethodExecute() override {}
83 
87  void CreateOutputWindow() override {}
88 
93  virtual int WaitForConnection(int port);
94 
99  virtual void CloseConnection();
100 
105  virtual int ConnectTo(const char* hostName, int port);
106 
108 
113 
124 
125  enum Consts
126  {
127  ENDIAN_TAG = 1010580540, // 0x3c3c3c3c
128  IDTYPESIZE_TAG = 1027423549, // 0x3d3d3d3d
129  VERSION_TAG = 1044266558, // 0x3e3e3e3e
130  HASH_TAG = 0x3f3f3f3f
131  };
132 
133 protected:
136 
137  // Initialize only once, finalize on destruction.
138  static int Initialized;
139 
140 private:
141  vtkSocketController(const vtkSocketController&) = delete;
142  void operator=(const vtkSocketController&) = delete;
143 };
144 
145 VTK_ABI_NAMESPACE_END
146 #endif // vtkSocketController_h
a simple class to control print indentation
Definition: vtkIndent.h:120
Multiprocessing communication superclass.
Process communication using Sockets.
Process communication using Sockets.
int GetSwapBytesInReceivedData()
void CreateOutputWindow() override
Does not apply to sockets.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void CloseConnection()
Close a connection, forwarded to the communicator.
void Initialize(int *argc, char ***argv, int) override
This method is for initialiazing sockets.
virtual int ConnectTo(const char *hostName, int port)
Open a connection to a give machine, forwarded to the communicator.
virtual void Initialize()
void Finalize() override
Does not apply to sockets.
~vtkSocketController() override
vtkMultiProcessController * CreateCompliantController()
FOOLISH MORTALS! Thou hast forsaken the sacred laws of ad-hoc polymorphism when thou broke a critical...
static vtkSocketController * New()
void MultipleMethodExecute() override
Does not apply to sockets.
void SetCommunicator(vtkSocketCommunicator *comm)
Set the communicator used in normal and rmi communications.
void SingleMethodExecute() override
Does not apply to sockets.
void Finalize(int) override
This method is for cleaning up.
void Initialize(int *argc, char ***argv) override
virtual int WaitForConnection(int port)
Wait for connection on a given port, forwarded to the communicator.
@ port
Definition: vtkX3D.h:459