vtkPVSession.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkPVSession_h
14 #define vtkPVSession_h
15 
16 #include "vtkObject.h"
17 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED
18 #include "vtkRemotingCoreModule.h" //needed for exports
19 
24 
26 {
27 public:
28  vtkTypeMacro(vtkPVSession, vtkObject);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  virtual bool GetIsAlive() = 0;
35 
37  {
38  NONE = 0,
39  DATA_SERVER = 0x01,
40  DATA_SERVER_ROOT = 0x02,
41  RENDER_SERVER = 0x04,
42  RENDER_SERVER_ROOT = 0x08,
43  SERVERS = DATA_SERVER | RENDER_SERVER,
44  CLIENT = 0x10,
45  CLIENT_AND_SERVERS = DATA_SERVER | CLIENT | RENDER_SERVER
46  };
47 
53  virtual ServerFlags GetProcessRoles();
54 
59  bool HasProcessRole(vtkTypeUInt32 flag)
60  {
61  return ((flag & static_cast<vtkTypeUInt32>(this->GetProcessRoles())) == flag);
62  }
63 
69  virtual vtkMultiProcessController* GetController(ServerFlags processType);
70 
76 
86  virtual vtkPVServerInformation* GetServerInformation() = 0;
87 
92  virtual bool IsMultiClients();
93 
95 
98  vtkGetObjectMacro(ProgressHandler, vtkPVProgressHandler);
100 
102 
105  void PrepareProgress();
106  void CleanupPendingProgress();
108 
113  bool GetPendingProgress();
114 
115 protected:
116  vtkPVSession();
117  ~vtkPVSession() override;
118 
119  enum
120  {
121  EXCEPTION_EVENT_TAG = 31416
122  };
123 
128  virtual bool OnWrongTagEvent(vtkObject* caller, unsigned long eventid, void* calldata);
129 
131 
134  virtual void PrepareProgressInternal();
135  virtual void CleanupPendingProgressInternal();
137 
143  virtual void Activate();
144 
150  virtual void DeActivate();
151 
153 
154 private:
155  vtkPVSession(const vtkPVSession&) = delete;
156  void operator=(const vtkPVSession&) = delete;
157 
158  int ProgressCount;
159  // This flags ensures that while we are waiting for an previous progress-pair
160  // to finish, we don't start new progress-pairs.
161  bool InCleanupPendingProgress;
162 };
163 
164 PARAVIEW_DEPRECATED_IN_6_1_0("Please use the `vtkPVSession` class instead.")
166 
167 #endif
bool HasProcessRole(vtkTypeUInt32 flag)
Convenience method that returns true if the current session is serving the indicated role on this pro...
Definition: vtkPVSession.h:59
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes...
Definition: vtkPVSession.h:75
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Gets features of the server.
vtkPVSession defines a session i.e.
Definition: vtkPVSession.h:25
class to create socket connections between two servers
const int NONE
vtkPVProgressHandler * ProgressHandler
Definition: vtkPVSession.h:152
#define PARAVIEW_DEPRECATED_IN_6_1_0(reason)
#define VTKREMOTINGCORE_EXPORT
void operator=(const vtkObjectBase &)
progress handler.