vtkPVSessionBase.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkPVSessionBase_h
13 #define vtkPVSessionBase_h
14 
15 #include "vtkPVSession.h"
16 #include "vtkRemotingServerManagerModule.h" //needed for exports
17 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage
18 
20 class vtkCollection;
21 class vtkSIObject;
22 class vtkPVInformation;
25 class vtkPVSessionCore;
26 
27 class VTKREMOTINGSERVERMANAGER_EXPORT vtkPVSessionBase : public vtkPVSession
28 {
29 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
33  enum EventIds
34  {
35  RegisterRemoteObjectEvent = 1234,
36  UnRegisterRemoteObjectEvent = 4321,
37  ProcessingRemoteEnd = 2143,
38  ConnectionLost = 6789,
39  ThreadedStreamStartEvent = 9001,
40  ThreadedStreamEndEvent = 9002
41  };
42 
43  //---------------------------------------------------------------------------
44  // Superclass Implementations
45  //---------------------------------------------------------------------------
46 
53  ServerFlags GetProcessRoles() override;
54 
64 
70 
71  //---------------------------------------------------------------------------
72  // Remote communication API. This API is used for communication in the
73  // CLIENT -> SERVER(s) direction.
74  //---------------------------------------------------------------------------
75 
79  virtual void PushState(vtkSMMessage* msg);
80 
84  virtual void PullState(vtkSMMessage* msg);
85 
92  virtual void ExecuteStream(vtkTypeUInt32 location, const vtkClientServerStream& stream,
93  bool ignoreErrors = false, bool sendReply = false, bool threadedStream = false);
94 
100  virtual const vtkClientServerStream& GetLastResult(vtkTypeUInt32 location);
101 
106  virtual bool GatherInformation(
107  vtkTypeUInt32 location, vtkPVInformation* information, vtkTypeUInt32 globalid);
108 
109  //---------------------------------------------------------------------------
110  // Remote communication API. This API is used for communication in the
111  // SERVER -> CLIENT direction. Since satellite nodes cannot communicate with
112  // the client, these methods have no effect on the satellite nodes and must
113  // only the called on the root-nodes for the server processes.
114  // If these methods are called on a process acting as a client, then it is
115  // processed on that process immediately, as appropriate.
116  //---------------------------------------------------------------------------
117 
121  virtual void NotifyAllClients(const vtkSMMessage*) = 0;
122 
126  virtual void NotifyOtherClients(const vtkSMMessage*) = 0;
127 
128  //---------------------------------------------------------------------------
129  // API dealing with/forwarded to vtkPVSessionCore dealing with SIObjects and
130  // SMObjects.
131  //---------------------------------------------------------------------------
132 
134 
137  vtkGetObjectMacro(SessionCore, vtkPVSessionCore);
139 
143  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
144 
148  vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
149 
153  virtual void UnRegisterSIObject(vtkSMMessage* msg);
154 
158  virtual void RegisterSIObject(vtkSMMessage* msg);
159 
163  vtkObject* GetRemoteObject(vtkTypeUInt32 globalid);
164 
170  virtual void GetAllRemoteObjects(vtkCollection* collection);
171 
172  //---------------------------------------------------------------------------
173  // API for GlobalId management
174  //---------------------------------------------------------------------------
175 
182  virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier();
183 
190  virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier(vtkTypeUInt32 chunkSize);
191 
198  virtual bool IsProcessingRemoteNotification();
199 
203  virtual void UseSessionCoreOf(vtkPVSessionBase* other);
204 
205 protected:
208  ~vtkPVSessionBase() override;
209 
211 
215  vtkPVSessionCore* GetSessionCore() const;
216  void SetSessionCore(vtkPVSessionCore*);
218 
220 
224  void PrepareProgressInternal() override;
225  void CleanupPendingProgressInternal() override;
227 
228  friend class vtkSMRemoteObject;
230  friend class vtkSMLiveInsituLinkProxy; // Needed to get access to vtkPVCatalystSessionCore
231 
233 
238  virtual bool StartProcessingRemoteNotification();
239  virtual void StopProcessingRemoteNotification(bool previousValue);
242 
246  void RegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location, vtkObject* obj);
247 
251  void UnRegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location);
252 
254 
255 private:
256  vtkPVSessionBase(const vtkPVSessionBase&) = delete;
257  void operator=(const vtkPVSessionBase&) = delete;
258 
259  // Shared constructor method
260  void InitSessionBase(vtkPVSessionCore* coreToUse);
261 
262  vtkPVServerInformation* LocalServerInformation;
263  unsigned long ActivateObserverTag;
264  unsigned long DesactivateObserverTag;
265 };
266 
267 #endif
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes...
Definition: vtkPVSession.h:75
Performs additional operation on the Live client.
vtkPVSessionCore * SessionCore
void PrintSelf(ostream &os, vtkIndent indent) override
Gets features of the server.
vtkPVSession defines a session i.e.
Definition: vtkPVSession.h:25
virtual void PrepareProgressInternal()
Virtual methods subclasses can override.
virtual void CleanupPendingProgressInternal()
Virtual methods subclasses can override.
Store messages for the interpreter.
vtkPVSessionCore is used by vtkSMSession.
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
virtual ServerFlags GetProcessRoles()
Returns a ServerFlags indicate the nature of the current processes.
class to create socket connections between two servers
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
Object that is managed by vtkPVSessionCore which wrap concrete class such as the vtk ones...
Definition: vtkSIObject.h:21
bool ProcessingRemoteNotification
Methods used to monitor if we are currently processing a server notification Only vtkSMSessionClient ...
object responsible for managing XML proxies definitions
Abstract class used to provide the main implementation of the ParaView session methods for the follow...
baseclass for all proxy-objects that have counter parts on server as well as client processes...
Superclass for information objects.
virtual vtkPVServerInformation * GetServerInformation()=0
vtkPVServerInformation is an information-object that provides information about the server processes...