1#ifndef QX_PROCCESSBIDER_H
2#define QX_PROCCESSBIDER_H
5#include "qx/core/qx_core_export.h"
13using namespace std::chrono_literals;
34 {FailedToHook, u
"Could not hook the process in order to bide on it."_s},
35 {FailedToClose, u
"Could not close the bided process."_s}
45 ProcessBiderError(Type t,
const QString& pn);
49 quint32 deriveValue()
const override;
50 QString derivePrimary()
const override;
51 QString deriveSecondary()
const override;
61 friend class ProcessBiderManager;
71 std::chrono::milliseconds mGrace;
73 std::chrono::milliseconds mPollRate;
86 bool isBiding()
const;
88 std::chrono::milliseconds respawnGrace()
const;
89 bool initialGrace()
const;
91 void setProcessName(
const QString& name);
92 void setRespawnGrace(std::chrono::milliseconds grace);
93 void setInitialGrace(
bool initialGrace);
96 std::chrono::milliseconds pollRate()
const;
97 void setPollRate(std::chrono::milliseconds rate);
102 void handleResultReady(ResultType result);
103 void handleCloseFailure();
108 void closeProcess(std::chrono::milliseconds timeout = 1000ms,
bool force =
false);
123 void __startClose(std::chrono::milliseconds timeout,
bool force);
The AbstractError template class completes the Error interface and acts as the base class from which ...
Definition qx-abstracterror.h:86
The ProcessBiderError class describes errors than can occur during process biding.
Definition qx-processbider.h:19
Type
Definition qx-processbider.h:24
@ FailedToHook
Definition qx-processbider.h:26
The ProcessBider class monitors the presence of a process and signals when that process ends.
Definition qx-processbider.h:60
void finished(ResultType result)
ResultType
Definition qx-processbider.h:65
void errorOccurred(ProcessBiderError error)
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
QString processName(quint32 processId)
Definition qx-system_linux.cpp:434
The qx-abstracterror.h header file provides access to the base class from which custom error types sh...