vtkPVSessionServer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkPVSessionServer_h
14 #define vtkPVSessionServer_h
15 
16 #include "vtkPVSessionBase.h"
17 #include "vtkRemotingServerManagerModule.h" //needed for exports
18 
21 
22 class VTKREMOTINGSERVERMANAGER_EXPORT vtkPVSessionServer : public vtkPVSessionBase
23 {
24 public:
25  static vtkPVSessionServer* New();
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
35 
49  virtual bool Connect(const char* url);
50 
55  bool Connect();
56 
60  bool GetIsAlive() override;
61 
65  enum
66  {
67  PUSH = 12,
68  PULL = 13,
69  EXECUTE_STREAM = 14,
70  GATHER_INFORMATION = 15,
71  REGISTER_SI = 16,
72  UNREGISTER_SI = 17,
73  LAST_RESULT = 18,
74  SERVER_NOTIFICATION_MESSAGE_RMI = 55624,
75  CLIENT_SERVER_MESSAGE_RMI = 55625,
76  CLOSE_SESSION = 55626,
77  REPLY_GATHER_INFORMATION_TAG = 55627,
78  REPLY_PULL = 55628,
79  REPLY_LAST_RESULT = 55629,
80  EXECUTE_STREAM_TAG = 55630
81  };
82 
84 
90  vtkBooleanMacro(MultipleConnection, bool);
91  vtkSetMacro(MultipleConnection, bool);
92  vtkGetMacro(MultipleConnection, bool);
94 
96 
100  vtkBooleanMacro(DisableFurtherConnections, bool);
101  vtkGetMacro(DisableFurtherConnections, bool);
102  void SetDisableFurtherConnections(bool disable);
104 
106 
110  void SetConnectID(int newConnectID);
111  int GetConnectID();
113 
114  void OnClientServerMessageRMI(void* message, int message_length);
115  void OnCloseSessionRMI();
116 
120  void NotifyAllClients(const vtkSMMessage*) override;
121 
125  void NotifyOtherClients(const vtkSMMessage*) override;
126 
127 protected:
129  ~vtkPVSessionServer() override;
130 
134  void GatherInformationInternal(
135  vtkTypeUInt32 location, const char* classname, vtkTypeUInt32 globalid, vtkMultiProcessStream&);
136 
140  void SendLastResultToClient();
141 
143 
146 
147  class vtkInternals;
148  vtkInternals* Internal;
149  friend class vtkInternals;
150 
151 private:
152  vtkPVSessionServer(const vtkPVSessionServer&) = delete;
153  void operator=(const vtkPVSessionServer&) = delete;
154 };
155 
156 #endif
vtkPVSessionBase.h
vtkPVSessionServer::Internal
vtkInternals * Internal
Definition: vtkPVSessionServer.h:147
vtkObject::New
static vtkObject * New()
vtkMultiProcessStream
vtkPVSessionBase::NotifyAllClients
virtual void NotifyAllClients(const vtkSMMessage *)=0
Sends the message to all clients.
vtkPVSessionBase
Definition: vtkPVSessionBase.h:27
vtkSession::GetIsAlive
virtual bool GetIsAlive()=0
Returns true is this session is active/alive/valid.
vtkPVSession::GetController
virtual vtkMultiProcessController * GetController(ServerFlags processType)
Returns the controller used to communicate with the process.
vtkPVSession::ServerFlags
ServerFlags
Definition: vtkPVSession.h:29
vtkMultiProcessController
vtkPVSessionServer
Definition: vtkPVSessionServer.h:22
vtkIndent
vtkSMMessage
vtkPVSessionServer::DisableFurtherConnections
bool DisableFurtherConnections
Definition: vtkPVSessionServer.h:145
vtkPVSessionBase::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkPVSessionServer::MPIMToNSocketConnection
vtkMPIMToNSocketConnection * MPIMToNSocketConnection
Definition: vtkPVSessionServer.h:142
vtkPVSessionServer::MultipleConnection
bool MultipleConnection
Definition: vtkPVSessionServer.h:144
vtkPVSessionBase::NotifyOtherClients
virtual void NotifyOtherClients(const vtkSMMessage *)=0
Sends the message to all but the active client-session.
vtkMPIMToNSocketConnection
class to create socket connections between two servers
Definition: vtkMPIMToNSocketConnection.h:32