Files
ResInsight/ApplicationLibCode/ProjectDataModel/ProcessControl/RimProcessMonitor.h
T
JJ f1923333af Job improvements (#13895)
* Add job wait/queued state
* Add support for limiting number of jobs running
* Add job queue for jobs waiting to run
2026-04-17 19:55:50 +02:00

55 lines
1.6 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QObject>
#include <QProcess>
#include <QString>
#include <QStringList>
class RimProcessMonitor : public QObject
{
Q_OBJECT
public:
explicit RimProcessMonitor( size_t processId, bool logStdOutErr = true );
void clearStdOutErr();
QStringList stdOut() const;
QStringList stdErr() const;
void setProcessId( size_t processId );
signals:
public slots:
virtual void error( QProcess::ProcessError error );
virtual void finished( int exitCode, QProcess::ExitStatus exitStatus );
virtual void readyReadStandardError();
virtual void readyReadStandardOutput();
virtual void started();
protected:
QString addPrefix( QString message );
size_t m_processId;
bool m_logStdOutErr;
QStringList m_stdOut;
QStringList m_stdErr;
};