vtkPVSessionServer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVSessionServer.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
25 #ifndef vtkPVSessionServer_h
26 #define vtkPVSessionServer_h
27 
28 #include "vtkPVSessionBase.h"
29 #include "vtkRemotingServerManagerModule.h" //needed for exports
30 
33 
35 {
36 public:
37  static vtkPVSessionServer* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
47 
61  virtual bool Connect(const char* url);
62 
67  bool Connect();
68 
72  bool GetIsAlive() override;
73 
77  enum
78  {
79  PUSH = 12,
80  PULL = 13,
81  EXECUTE_STREAM = 14,
82  GATHER_INFORMATION = 15,
83  REGISTER_SI = 16,
84  UNREGISTER_SI = 17,
85  LAST_RESULT = 18,
86  SERVER_NOTIFICATION_MESSAGE_RMI = 55624,
87  CLIENT_SERVER_MESSAGE_RMI = 55625,
88  CLOSE_SESSION = 55626,
89  REPLY_GATHER_INFORMATION_TAG = 55627,
90  REPLY_PULL = 55628,
91  REPLY_LAST_RESULT = 55629,
92  EXECUTE_STREAM_TAG = 55630
93  };
94 
96 
102  vtkBooleanMacro(MultipleConnection, bool);
103  vtkSetMacro(MultipleConnection, bool);
104  vtkGetMacro(MultipleConnection, bool);
106 
108 
112  vtkBooleanMacro(DisableFurtherConnections, bool);
113  vtkGetMacro(DisableFurtherConnections, bool);
114  void SetDisableFurtherConnections(bool disable);
116 
118 
122  void SetConnectID(int newConnectID);
123  int GetConnectID();
125 
126  void OnClientServerMessageRMI(void* message, int message_length);
127  void OnCloseSessionRMI();
128 
132  void NotifyAllClients(const vtkSMMessage*) override;
133 
137  void NotifyOtherClients(const vtkSMMessage*) override;
138 
139 protected:
141  ~vtkPVSessionServer() override;
142 
146  void GatherInformationInternal(
147  vtkTypeUInt32 location, const char* classname, vtkTypeUInt32 globalid, vtkMultiProcessStream&);
148 
152  void SendLastResultToClient();
153 
155 
158 
159  class vtkInternals;
160  vtkInternals* Internal;
161  friend class vtkInternals;
162 
163 private:
164  vtkPVSessionServer(const vtkPVSessionServer&) = delete;
165  void operator=(const vtkPVSessionServer&) = delete;
166 };
167 
168 #endif
#define VTKREMOTINGSERVERMANAGER_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMPIMToNSocketConnection * MPIMToNSocketConnection
virtual void NotifyOtherClients(const vtkSMMessage *)=0
Sends the message to all but the active client-session.
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
class to create socket connections between two servers
vtkInternals * Internal
virtual bool GetIsAlive()=0
Returns true is this session is active/alive/valid.
virtual void NotifyAllClients(const vtkSMMessage *)=0
Sends the message to all clients.
vtkSMSessionServer is a session used on data and/or render servers.
Abstract class used to provide the main implementation of the ParaView session methods for the follow...
static vtkObject * New()
virtual vtkMultiProcessController * GetController(ServerFlags processType)
Returns the controller used to communicate with the process.