pqServerLauncher.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqServerLauncher_h
5 #define pqServerLauncher_h
6 
7 #include "pqComponentsModule.h"
8 #include <QObject>
9 #include <QProcess> // needed for QProcess::ProcessError.
10 
11 class pqServer;
13 class QDialog;
14 class QProcessEnvironment;
15 class vtkObject;
16 
29 class PQCOMPONENTS_EXPORT pqServerLauncher : public QObject
30 {
31  Q_OBJECT
32  typedef QObject Superclass;
33 
34 public:
35  pqServerLauncher(const pqServerConfiguration& configuration, QObject* parent = nullptr);
36  ~pqServerLauncher() override;
37 
45  static const QMetaObject* setServerDefaultLauncherType(const QMetaObject*);
46  static const QMetaObject* defaultServerLauncherType();
47 
52  static pqServerLauncher* newInstance(
53  const pqServerConfiguration& configuration, QObject* parent = nullptr);
54 
62  bool connectToServer(bool showConnectionDialog = true);
63 
68  pqServer* connectedServer() const;
69 
70 protected Q_SLOTS:
71  void processFailed(QProcess::ProcessError);
72  void readStandardOutput();
73  void readStandardError();
74  void launchServerForReverseConnection();
75 
76 protected: // NOLINT(readability-redundant-access-specifiers)
82  bool promptOptions();
83 
88  virtual bool launchServer(bool show_status_dialog);
89 
93  bool processCommand(QString command, double processWait, double delay,
94  const QProcessEnvironment* options = nullptr);
95 
96  virtual bool connectToPrelaunchedServer(bool showConnectionDialog = true);
97 
98  bool isReverseConnection() const;
99 
105  virtual void prepareDialogForPromptOptions(QDialog&) {}
106 
112  pqServerConfiguration& configuration() const;
113 
117  QProcessEnvironment& options() const;
118 
122  virtual void updateOptionsUsingUserSelections();
123 
129  virtual void handleProcessStandardOutput(const QByteArray& data);
130  virtual void handleProcessErrorOutput(const QByteArray& data);
131 
132 private:
133  Q_DISABLE_COPY(pqServerLauncher)
134 
135  class pqInternals;
136  pqInternals* Internals;
137  static const QMetaObject* DefaultServerLauncherType;
138  bool WrongConnectId;
139 };
140 
141 #endif
data
#define PQCOMPONENTS_EXPORT
pqServerLauncher manages launching of server process using the details specified in the server config...
pqServerConfiguration corresponds to a server connection configuration.
virtual void prepareDialogForPromptOptions(QDialog &)
Subclasses can override this method to further customize the dialog being shown to the user to prompt...
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35