vtkPVSessionBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVSessionBase.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 =========================================================================*/
24 #ifndef vtkPVSessionBase_h
25 #define vtkPVSessionBase_h
26 
27 #include "vtkPVSession.h"
28 #include "vtkRemotingServerManagerModule.h" //needed for exports
29 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage
30 
32 class vtkCollection;
33 class vtkSIObject;
34 class vtkPVInformation;
37 class vtkPVSessionCore;
38 
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  enum EventIds
46  {
47  RegisterRemoteObjectEvent = 1234,
48  UnRegisterRemoteObjectEvent = 4321,
49  ProcessingRemoteEnd = 2143,
50  ConnectionLost = 6789
51  };
52 
53  //---------------------------------------------------------------------------
54  // Superclass Implementations
55  //---------------------------------------------------------------------------
56 
63  ServerFlags GetProcessRoles() override;
64 
74 
80 
81  //---------------------------------------------------------------------------
82  // Remote communication API. This API is used for communication in the
83  // CLIENT -> SERVER(s) direction.
84  //---------------------------------------------------------------------------
85 
89  virtual void PushState(vtkSMMessage* msg);
90 
94  virtual void PullState(vtkSMMessage* msg);
95 
101  virtual void ExecuteStream(
102  vtkTypeUInt32 location, const vtkClientServerStream& stream, bool ignore_errors = false);
103 
109  virtual const vtkClientServerStream& GetLastResult(vtkTypeUInt32 location);
110 
115  virtual bool GatherInformation(
116  vtkTypeUInt32 location, vtkPVInformation* information, vtkTypeUInt32 globalid);
117 
118  //---------------------------------------------------------------------------
119  // Remote communication API. This API is used for communication in the
120  // SERVER -> CLIENT direction. Since satellite nodes cannot communicate with
121  // the client, these methods have no effect on the satellite nodes and must
122  // only the called on the root-nodes for the server processes.
123  // If these methods are called on a process acting as a client, then it is
124  // processed on that process immediately, as appropriate.
125  //---------------------------------------------------------------------------
126 
130  virtual void NotifyAllClients(const vtkSMMessage*) = 0;
131 
135  virtual void NotifyOtherClients(const vtkSMMessage*) = 0;
136 
137  //---------------------------------------------------------------------------
138  // API dealing with/forwarded to vtkPVSessionCore dealing with SIObjects and
139  // SMObjects.
140  //---------------------------------------------------------------------------
141 
143 
146  vtkGetObjectMacro(SessionCore, vtkPVSessionCore);
148 
152  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
153 
157  vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
158 
162  virtual void UnRegisterSIObject(vtkSMMessage* msg);
163 
167  virtual void RegisterSIObject(vtkSMMessage* msg);
168 
172  vtkObject* GetRemoteObject(vtkTypeUInt32 globalid);
173 
179  virtual void GetAllRemoteObjects(vtkCollection* collection);
180 
181  //---------------------------------------------------------------------------
182  // API for GlobalId management
183  //---------------------------------------------------------------------------
184 
191  virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier();
192 
199  virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier(vtkTypeUInt32 chunkSize);
200 
207  virtual bool IsProcessingRemoteNotification();
208 
212  virtual void UseSessionCoreOf(vtkPVSessionBase* other);
213 
214 protected:
217  ~vtkPVSessionBase() override;
218 
220 
224  vtkPVSessionCore* GetSessionCore() const;
225  void SetSessionCore(vtkPVSessionCore*);
227 
229 
233  void PrepareProgressInternal() override;
234  void CleanupPendingProgressInternal() override;
236 
237  friend class vtkSMRemoteObject;
239  friend class vtkSMLiveInsituLinkProxy; // Needed to get access to vtkPVCatalystSessionCore
240 
242 
247  virtual bool StartProcessingRemoteNotification();
248  virtual void StopProcessingRemoteNotification(bool previousValue);
251 
255  void RegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location, vtkObject* obj);
256 
260  void UnRegisterRemoteObject(vtkTypeUInt32 globalid, vtkTypeUInt32 location);
261 
263 
264 private:
265  vtkPVSessionBase(const vtkPVSessionBase&) = delete;
266  void operator=(const vtkPVSessionBase&) = delete;
267 
268  // Shared constructor method
269  void InitSessionBase(vtkPVSessionCore* coreToUse);
270 
271  vtkPVServerInformation* LocalServerInformation;
272  unsigned long ActivateObserverTag;
273  unsigned long DesactivateObserverTag;
274 };
275 
276 #endif
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes...
Definition: vtkPVSession.h:80
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:35
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:33
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...