vtkPVSession.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVSession.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 vtkPVSession_h
25 #define vtkPVSession_h
26 
27 #include "vtkRemotingCoreModule.h" //needed for exports
28 #include "vtkSession.h"
29 
34 
36 {
37 public:
38  vtkTypeMacro(vtkPVSession, vtkSession);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42  {
43  NONE = 0,
44  DATA_SERVER = 0x01,
45  DATA_SERVER_ROOT = 0x02,
46  RENDER_SERVER = 0x04,
47  RENDER_SERVER_ROOT = 0x08,
48  SERVERS = DATA_SERVER | RENDER_SERVER,
49  CLIENT = 0x10,
50  CLIENT_AND_SERVERS = DATA_SERVER | CLIENT | RENDER_SERVER
51  };
52 
58  virtual ServerFlags GetProcessRoles();
59 
64  bool HasProcessRole(vtkTypeUInt32 flag)
65  {
66  return ((flag & static_cast<vtkTypeUInt32>(this->GetProcessRoles())) == flag);
67  }
68 
74  virtual vtkMultiProcessController* GetController(ServerFlags processType);
75 
81 
91  virtual vtkPVServerInformation* GetServerInformation() = 0;
92 
97  virtual bool IsMultiClients();
98 
100 
103  vtkGetObjectMacro(ProgressHandler, vtkPVProgressHandler);
105 
107 
110  void PrepareProgress();
111  void CleanupPendingProgress();
113 
118  bool GetPendingProgress();
119 
120 protected:
121  vtkPVSession();
122  ~vtkPVSession() override;
123 
124  enum
125  {
126  EXCEPTION_EVENT_TAG = 31416
127  };
128 
133  virtual bool OnWrongTagEvent(vtkObject* caller, unsigned long eventid, void* calldata);
134 
136 
139  virtual void PrepareProgressInternal();
140  virtual void CleanupPendingProgressInternal();
142 
144 
145 private:
146  vtkPVSession(const vtkPVSession&) = delete;
147  void operator=(const vtkPVSession&) = delete;
148 
149  int ProgressCount;
150  // This flags ensures that while we are waiting for an previous progress-pair
151  // to finish, we don't start new progress-pairs.
152  bool InCleanupPendingProgress;
153 };
154 
155 #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:64
virtual vtkMPIMToNSocketConnection * GetMPIMToNSocketConnection()
This is socket connection, if any to communicate between the data-server and render-server nodes...
Definition: vtkPVSession.h:80
Gets features of the server.
extends vtkSession to add API for ParaView sessions.
Definition: vtkPVSession.h:35
class to create socket connections between two servers
const int NONE
vtkPVProgressHandler * ProgressHandler
Definition: vtkPVSession.h:143
#define VTKREMOTINGCORE_EXPORT
vtkSession defines a session i.e.
Definition: vtkSession.h:29
void PrintSelf(ostream &os, vtkIndent indent) override
progress handler.