vtkPVSessionCore.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkPVSessionCore_h
14 #define vtkPVSessionCore_h
15 
16 #include "vtkObject.h"
17 #include "vtkRemotingServerManagerModule.h" //needed for exports
18 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage.
19 #include "vtkWeakPointer.h" // needed for vtkMultiProcessController
20 
23 class vtkCollection;
26 class vtkPVInformation;
27 class vtkSIObject;
29 
31 {
32 public:
33  static vtkPVSessionCore* New();
34  vtkTypeMacro(vtkPVSessionCore, vtkObject);
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
41  vtkGetObjectMacro(Interpreter, vtkClientServerInterpreter);
43 
45 
48  vtkGetObjectMacro(ProxyDefinitionManager, vtkSIProxyDefinitionManager);
50 
55  virtual void PushState(vtkSMMessage* message);
56 
60  virtual void PullState(vtkSMMessage* message);
61 
67  virtual void ExecuteStream(
68  vtkTypeUInt32 location, const vtkClientServerStream& stream, bool ignore_errors = false);
69 
75  virtual const vtkClientServerStream& GetLastResult();
76 
82  virtual void UnRegisterSIObject(vtkSMMessage* message);
83 
88  virtual void RegisterSIObject(vtkSMMessage* message);
89 
94  vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
95 
99  vtkObject* GetRemoteObject(vtkTypeUInt32 globalid);
100 
104  void RegisterRemoteObject(vtkTypeUInt32 globalid, vtkObject* obj);
105 
109  void UnRegisterRemoteObject(vtkTypeUInt32 globalid);
110 
115  virtual bool GatherInformation(
116  vtkTypeUInt32 location, vtkPVInformation* information, vtkTypeUInt32 globalid);
117 
122  int GetNumberOfProcesses();
123 
125 
130  void SetMPIMToNSocketConnection(vtkMPIMToNSocketConnection*);
131  vtkGetObjectMacro(MPIMToNSocketConnection, vtkMPIMToNSocketConnection);
133 
140  virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier();
141 
148  virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier(vtkTypeUInt32 chunkSize);
149 
151  {
152  PUSH_STATE = 12,
153  PULL_STATE = 13,
154  EXECUTE_STREAM = 14,
155  GATHER_INFORMATION = 15,
156  REGISTER_SI = 16,
157  UNREGISTER_SI = 17,
158  };
159  // Methods used to managed MPI satellite
160  void PushStateSatelliteCallback();
161  void ExecuteStreamSatelliteCallback();
162  void GatherInformationStatelliteCallback();
163  void RegisterSIObjectSatelliteCallback();
164  void UnRegisterSIObjectSatelliteCallback();
165 
171  virtual void GetAllRemoteObjects(vtkCollection* collection);
172 
177  void GarbageCollectSIObject(int* clientIds, int nbClients);
178 
179 protected:
181  ~vtkPVSessionCore() override;
182 
187  virtual void PushStateInternal(vtkSMMessage*);
188 
193  virtual void ExecuteStreamInternal(const vtkClientServerStream& stream, bool ignore_errors);
194 
199  bool GatherInformationInternal(vtkPVInformation* information, vtkTypeUInt32 globalid);
200 
204  bool CollectInformation(vtkPVInformation*);
205 
209  virtual void RegisterSIObjectInternal(vtkSMMessage* message);
210 
216  virtual void UnRegisterSIObjectInternal(vtkSMMessage* message);
217 
221  void OnInterpreterError(vtkObject*, unsigned long, void* calldata);
222 
223  enum
224  {
225  ROOT_SATELLITE_RMI_TAG = 887822,
226  ROOT_SATELLITE_INFO_TAG = 887823
227  };
228 
233 
234 private:
235  vtkPVSessionCore(const vtkPVSessionCore&) = delete;
236  void operator=(const vtkPVSessionCore&) = delete;
237 
238  class vtkInternals;
239  vtkInternals* Internals;
240  bool SymmetricMPIMode;
241 
242  // Local counter for global Ids
243  vtkTypeUInt32 LocalGlobalID;
244 
245  ostream* LogStream;
246 };
247 
248 #endif
#define VTKREMOTINGSERVERMANAGER_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkWeakPointer< vtkMultiProcessController > ParallelController
Store messages for the interpreter.
vtkPVSessionCore is used by vtkSMSession.
Run-time VTK interpreter.
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
class to create socket connections between two servers
Object that is managed by vtkPVSessionCore which wrap concrete class such as the vtk ones...
Definition: vtkSIObject.h:21
vtkSIProxyDefinitionManager * ProxyDefinitionManager
vtkClientServerInterpreter * Interpreter
object responsible for managing XML proxies definitions
static vtkObject * New()
void operator=(const vtkObjectBase &)
vtkMPIMToNSocketConnection * MPIMToNSocketConnection
Superclass for information objects.