VTK  9.3.0
vtkSocketController.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
32 #ifndef vtkSocketController_h
33 #define vtkSocketController_h
34 
36 #include "vtkParallelCoreModule.h" // For export macro
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 
41 class VTKPARALLELCORE_EXPORT vtkSocketController : public vtkMultiProcessController
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  void Initialize(int* argc, char*** argv, int) override { this->Initialize(argc, argv); }
53  void Initialize(int* argc, char*** argv) override;
54  virtual void Initialize() { this->Initialize(nullptr, nullptr); }
55 
59  void Finalize() override {}
60  void Finalize(int) override {}
61 
65  void SingleMethodExecute() override {}
66 
70  void MultipleMethodExecute() override {}
71 
75  void CreateOutputWindow() override {}
76 
81  virtual int WaitForConnection(int port);
82 
87  virtual void CloseConnection();
88 
93  virtual int ConnectTo(const char* hostName, int port);
94 
96 
101 
112 
113  enum Consts
114  {
115  ENDIAN_TAG = 1010580540, // 0x3c3c3c3c
116  IDTYPESIZE_TAG = 1027423549, // 0x3d3d3d3d
117  VERSION_TAG = 1044266558, // 0x3e3e3e3e
118  HASH_TAG = 0x3f3f3f3f
119  };
120 
121 protected:
124 
125  // Initialize only once, finalize on destruction.
126  static int Initialized;
127 
128 private:
129  vtkSocketController(const vtkSocketController&) = delete;
130  void operator=(const vtkSocketController&) = delete;
131 };
132 
133 VTK_ABI_NAMESPACE_END
134 #endif // vtkSocketController_h
a simple class to control print indentation
Definition: vtkIndent.h:38
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:447