VTK: Parallel/Core/vtkSocketController.h Source File

| VTK 9.3.1

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
35 #include "vtkMultiProcessController.h"
36 #include "vtkParallelCoreModule.h" // For export macro
37
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkSocketCommunicator;
40
41 class VTKPARALLELCORE_EXPORT vtkSocketController : public vtkMultiProcessController
42 {
43 public:
44 static vtkSocketController* New();
45 vtkTypeMacro(vtkSocketController, vtkMultiProcessController);
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
95 int GetSwapBytesInReceivedData();
96
100 void SetCommunicator(vtkSocketCommunicator* comm);
101
111 vtkMultiProcessController* CreateCompliantController();
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:
122 vtkSocketController();
123 ~vtkSocketController() override;
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
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkMultiProcessController::Consts
Consts
Definition: vtkMultiProcessController.h:361
vtkSocketCommunicator
Process communication using Sockets.
Definition: vtkSocketCommunicator.h:54
vtkSocketController
Process communication using Sockets.
Definition: vtkSocketController.h:42
vtkSocketController::GetSwapBytesInReceivedData
int GetSwapBytesInReceivedData()
vtkSocketController::CreateOutputWindow
void CreateOutputWindow() override
Does not apply to sockets.
Definition: vtkSocketController.h:75
vtkSocketController::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSocketController::CloseConnection
virtual void CloseConnection()
Close a connection, forwarded to the communicator.
vtkSocketController::Initialize
void Initialize(int *argc, char ***argv, int) override
This method is for initialiazing sockets.
Definition: vtkSocketController.h:52
vtkSocketController::Initialized
static int Initialized
Definition: vtkSocketController.h:126
vtkSocketController::ConnectTo
virtual int ConnectTo(const char *hostName, int port)
Open a connection to a give machine, forwarded to the communicator.
vtkSocketController::Initialize
virtual void Initialize()
Definition: vtkSocketController.h:54
vtkSocketController::Finalize
void Finalize() override
Does not apply to sockets.
Definition: vtkSocketController.h:59
vtkSocketController::~vtkSocketController
~vtkSocketController() override
vtkSocketController::CreateCompliantController
vtkMultiProcessController * CreateCompliantController()
FOOLISH MORTALS! Thou hast forsaken the sacred laws of ad-hoc polymorphism when thou broke a critical...
vtkSocketController::New
static vtkSocketController * New()
vtkSocketController::MultipleMethodExecute
void MultipleMethodExecute() override
Does not apply to sockets.
Definition: vtkSocketController.h:70
vtkSocketController::SetCommunicator
void SetCommunicator(vtkSocketCommunicator *comm)
Set the communicator used in normal and rmi communications.
vtkSocketController::SingleMethodExecute
void SingleMethodExecute() override
Does not apply to sockets.
Definition: vtkSocketController.h:65
vtkSocketController::Finalize
void Finalize(int) override
This method is for cleaning up.
Definition: vtkSocketController.h:60
vtkSocketController::Initialize
void Initialize(int *argc, char ***argv) override
vtkSocketController::WaitForConnection
virtual int WaitForConnection(int port)
Wait for connection on a given port, forwarded to the communicator.
vtkSocketController::vtkSocketController
vtkSocketController()
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMultiProcessController.h