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 
89  virtual void ExecuteStream(
90  vtkTypeUInt32 location, const vtkClientServerStream& stream, bool ignore_errors = false);
91 
97  virtual const vtkClientServerStream& GetLastResult(vtkTypeUInt32 location);
98 
103  virtual bool GatherInformation(
104  vtkTypeUInt32 location, vtkPVInformation* information, vtkTypeUInt32 globalid);
105 
106  //---------------------------------------------------------------------------
107  // Remote communication API. This API is used for communication in the
108  // SERVER -> CLIENT direction. Since satellite nodes cannot communicate with
109  // the client, these methods have no effect on the satellite nodes and must
110  // only the called on the root-nodes for the server processes.
111  // If these methods are called on a process acting as a client, then it is
112  // processed on that process immediately, as appropriate.
113  //---------------------------------------------------------------------------
114 
118  virtual void NotifyAllClients(const vtkSMMessage*) = 0;
119 
123  virtual void NotifyOtherClients(const vtkSMMessage*) = 0;
124 
125  //---------------------------------------------------------------------------
126  // API dealing with/forwarded to vtkPVSessionCore dealing with SIObjects and
127  // SMObjects.
128  //---------------------------------------------------------------------------
129 
131 
134  vtkGetObjectMacro(SessionCore, vtkPVSessionCore);
136 
140  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
141 
145  vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
146 
150  virtual void UnRegisterSIObject(vtkSMMessage* msg);
151 
155  virtual void RegisterSIObject(vtkSMMessage* msg);
156 
160  vtkObject* GetRemoteObject(vtkTypeUInt32 globalid);
161 
167  virtual void GetAllRemoteObjects(vtkCollection* collection);
168 
169  //---------------------------------------------------------------------------
170  // API for GlobalId management
171  //---------------------------------------------------------------------------
172 
179  virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier();
180 
187  virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier(vtkTypeUInt32 chunkSize);
188 
195  virtual bool IsProcessingRemoteNotification();
196 
200  virtual void UseSessionCoreOf(vtkPVSessionBase* other);
201 
202 protected:
205  ~vtkPVSessionBase() override;
206 
208 
212  vtkPVSessionCore* GetSessionCore() const;
213  void SetSessionCore(vtkPVSessionCore*);
215 
217 
221  void PrepareProgressInternal() override;
222  void CleanupPendingProgressInternal() override;
224 
225  friend class vtkSMRemoteObject;
227  friend class vtkSMLiveInsituLinkProxy; // Needed to get access to vtkPVCatalystSessionCore
228 
230 
235  virtual bool StartProcessingRemoteNotification();
236  virtual void StopProcessingRemoteNotification(bool previousValue);
239 
243  void RegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location, vtkObject* obj);
244 
248  void UnRegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location);
249 
251 
252 private:
253  vtkPVSessionBase(const vtkPVSessionBase&) = delete;
254  void operator=(const vtkPVSessionBase&) = delete;
255 
256  // Shared constructor method
257  void InitSessionBase(vtkPVSessionCore* coreToUse);
258 
259  vtkPVServerInformation* LocalServerInformation;
260  unsigned long ActivateObserverTag;
261  unsigned long DesactivateObserverTag;
262 };
263 
264 #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...