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  };
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
vtkSMSessionProxyManager
Definition: vtkSMSessionProxyManager.h:135
vtkPVSessionBase::ProcessingRemoteNotification
bool ProcessingRemoteNotification
Methods used to monitor if we are currently processing a server notification Only vtkSMSessionClient ...
Definition: vtkPVSessionBase.h:237
vtkPVServerInformation
Gets features of the server.
Definition: vtkPVServerInformation.h:22
vtkSIObject
Definition: vtkSIObject.h:21
vtkSMLiveInsituLinkProxy
Performs additional operation on the Live client.
Definition: vtkSMLiveInsituLinkProxy.h:25
vtkClientServerStream
Store messages for the interpreter.
Definition: vtkClientServerStream.h:23
vtkObject
vtkPVSession::GetProcessRoles
virtual ServerFlags GetProcessRoles()
Returns a ServerFlags indicate the nature of the current processes.
vtkPVSessionBase
Definition: vtkPVSessionBase.h:27
vtkCollection
vtkPVSession::GetMPIMToNSocketConnection
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes.
Definition: vtkPVSession.h:68
vtkSIProxyDefinitionManager
object responsible for managing XML proxies definitions
Definition: vtkSIProxyDefinitionManager.h:40
vtkSMRemoteObject
baseclass for all proxy-objects that have counter parts on server as well as client processes.
Definition: vtkSMRemoteObject.h:25
vtkPVSession::GetServerInformation
virtual vtkPVServerInformation * GetServerInformation()=0
vtkPVServerInformation is an information-object that provides information about the server processes.
vtkPVSession.h
vtkIndent
vtkPVSession::CleanupPendingProgressInternal
virtual void CleanupPendingProgressInternal()
Virtual methods subclasses can override.
vtkPVSession
extends vtkSession to add API for ParaView sessions.
Definition: vtkPVSession.h:23
vtkSMMessage
vtkPVSessionBase::SessionCore
vtkPVSessionCore * SessionCore
Definition: vtkPVSessionBase.h:250
vtkPVSessionCore
Definition: vtkPVSessionCore.h:30
vtkPVInformation
Superclass for information objects.
Definition: vtkPVInformation.h:19
vtkPVSession::PrepareProgressInternal
virtual void PrepareProgressInternal()
Virtual methods subclasses can override.
vtkPVSessionBase::EventIds
EventIds
Definition: vtkPVSessionBase.h:33
vtkMPIMToNSocketConnection
class to create socket connections between two servers
Definition: vtkMPIMToNSocketConnection.h:32
vtkSMMessageMinimal.h
vtkPVSession::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override