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 
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  };
40 
41  //---------------------------------------------------------------------------
42  // Superclass Implementations
43  //---------------------------------------------------------------------------
44 
51  ServerFlags GetProcessRoles() override;
52 
62 
68 
69  //---------------------------------------------------------------------------
70  // Remote communication API. This API is used for communication in the
71  // CLIENT -> SERVER(s) direction.
72  //---------------------------------------------------------------------------
73 
77  virtual void PushState(vtkSMMessage* msg);
78 
82  virtual void PullState(vtkSMMessage* msg);
83 
90  virtual void ExecuteStream(vtkTypeUInt32 location, const vtkClientServerStream& stream,
91  bool ignoreErrors = false, bool sendReply = false);
92 
98  virtual const vtkClientServerStream& GetLastResult(vtkTypeUInt32 location);
99 
104  virtual bool GatherInformation(
105  vtkTypeUInt32 location, vtkPVInformation* information, vtkTypeUInt32 globalid);
106 
107  //---------------------------------------------------------------------------
108  // Remote communication API. This API is used for communication in the
109  // SERVER -> CLIENT direction. Since satellite nodes cannot communicate with
110  // the client, these methods have no effect on the satellite nodes and must
111  // only the called on the root-nodes for the server processes.
112  // If these methods are called on a process acting as a client, then it is
113  // processed on that process immediately, as appropriate.
114  //---------------------------------------------------------------------------
115 
119  virtual void NotifyAllClients(const vtkSMMessage*) = 0;
120 
124  virtual void NotifyOtherClients(const vtkSMMessage*) = 0;
125 
126  //---------------------------------------------------------------------------
127  // API dealing with/forwarded to vtkPVSessionCore dealing with SIObjects and
128  // SMObjects.
129  //---------------------------------------------------------------------------
130 
132 
135  vtkGetObjectMacro(SessionCore, vtkPVSessionCore);
137 
141  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
142 
146  vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
147 
151  virtual void UnRegisterSIObject(vtkSMMessage* msg);
152 
156  virtual void RegisterSIObject(vtkSMMessage* msg);
157 
161  vtkObject* GetRemoteObject(vtkTypeUInt32 globalid);
162 
168  virtual void GetAllRemoteObjects(vtkCollection* collection);
169 
170  //---------------------------------------------------------------------------
171  // API for GlobalId management
172  //---------------------------------------------------------------------------
173 
180  virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier();
181 
188  virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier(vtkTypeUInt32 chunkSize);
189 
196  virtual bool IsProcessingRemoteNotification();
197 
201  virtual void UseSessionCoreOf(vtkPVSessionBase* other);
202 
203 protected:
206  ~vtkPVSessionBase() override;
207 
209 
213  vtkPVSessionCore* GetSessionCore() const;
214  void SetSessionCore(vtkPVSessionCore*);
216 
218 
222  void PrepareProgressInternal() override;
223  void CleanupPendingProgressInternal() override;
225 
226  friend class vtkSMRemoteObject;
228  friend class vtkSMLiveInsituLinkProxy; // Needed to get access to vtkPVCatalystSessionCore
229 
231 
236  virtual bool StartProcessingRemoteNotification();
237  virtual void StopProcessingRemoteNotification(bool previousValue);
240 
244  void RegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location, vtkObject* obj);
245 
249  void UnRegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location);
250 
252 
253 private:
254  vtkPVSessionBase(const vtkPVSessionBase&) = delete;
255  void operator=(const vtkPVSessionBase&) = delete;
256 
257  // Shared constructor method
258  void InitSessionBase(vtkPVSessionCore* coreToUse);
259 
260  vtkPVServerInformation* LocalServerInformation;
261  unsigned long ActivateObserverTag;
262  unsigned long DesactivateObserverTag;
263 };
264 
265 #endif
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes...
Definition: vtkPVSession.h:68
Performs additional operation on the Live client.
vtkPVSessionCore * SessionCore
#define VTKREMOTINGSERVERMANAGER_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) override
Gets features of the server.
extends vtkSession to add API for ParaView sessions.
Definition: vtkPVSession.h:23
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...