NepomukDaemons
ProcessControl Class Reference
This class starts and observes a process. More...
#include <processcontrol.h>
Inheritance diagram for ProcessControl:

Public Types | |
enum | CrashPolicy { StopOnCrash, RestartOnCrash } |
Signals | |
void | finished (bool clean) |
void | processErrorMessages (const QString &errorMsg) |
Public Member Functions | |
bool | isRunning () const |
ProcessControl (QObject *parent=0) | |
void | setCrashPolicy (CrashPolicy policy) |
bool | start (const QString &application, const QStringList &arguments=QStringList(), CrashPolicy policy=RestartOnCrash, int maxCrashes=5) |
void | stop () |
~ProcessControl () |
Detailed Description
This class starts and observes a process.Depending on the policy it also restarts the process when it crashes.
Definition at line 32 of file processcontrol.h.
Member Enumeration Documentation
Theses enums describe the behaviour when the observed application crashed.
- StopOnCrash - The application won't be restarted.
- RestartOnCrash - The application is restarted with the same arguments.
Definition at line 44 of file processcontrol.h.
Constructor & Destructor Documentation
ProcessControl::ProcessControl | ( | QObject * | parent = 0 |
) |
Creates a new process control.
- Parameters:
-
parent The parent object.
Definition at line 27 of file processcontrol.cpp.
ProcessControl::~ProcessControl | ( | ) |
Member Function Documentation
void ProcessControl::finished | ( | bool | clean | ) | [signal] |
bool ProcessControl::isRunning | ( | ) | const |
Definition at line 134 of file processcontrol.cpp.
void ProcessControl::processErrorMessages | ( | const QString & | errorMsg | ) | [signal] |
This signal is emitted whenever the observed application writes something to stderr.
- Parameters:
-
errorMsg The error output of the observed application.
void ProcessControl::setCrashPolicy | ( | CrashPolicy | policy | ) |
bool ProcessControl::start | ( | const QString & | application, | |
const QStringList & | arguments = QStringList() , |
|||
CrashPolicy | policy = RestartOnCrash , |
|||
int | maxCrashes = 5 | |||
) |
Starts the application
with the given list of arguments
.
Definition at line 45 of file processcontrol.cpp.
void ProcessControl::stop | ( | ) |
The documentation for this class was generated from the following files: