MythTV
master
|
class for managing sub-processes. More...
#include <libmythbase/mythsystem.h>
Public Types | |
enum | Priority : std::uint8_t { kIdlePriority = 0, kLowestPriority, kLowPriority, kNormalPriority, kHighPriority, kHighestPriority, kTimeCriticalPriority, kInheritPriority } |
Priorities that can be used for cpu and disk usage of child process. More... | |
Public Member Functions | |
virtual | ~MythSystem (void)=default |
MythSystem (const MythSystem &)=delete | |
MythSystem & | operator= (const MythSystem &)=delete |
virtual uint | GetFlags (void) const =0 |
Returns the flags passed to the constructor. More... | |
virtual QString | GetStartingPath (void) const =0 |
Returns the starting path of the program. More... | |
virtual Priority | GetCPUPriority (void) const =0 |
Return the CPU Priority of the program. More... | |
virtual Priority | GetDiskPriority (void) const =0 |
Return the Disk Priority of the program. More... | |
virtual bool | Wait (std::chrono::milliseconds timeout=0ms)=0 |
Blocks until child process is collected or timeout reached. More... | |
virtual QIODevice * | GetStandardInputStream (void)=0 |
Returns the standard input stream for the program if the kMSStdIn flag was passed to the constructor. More... | |
virtual QIODevice * | GetStandardOutputStream (void)=0 |
Returns the standard output stream for the program if the kMSStdOut flag was passed to the constructor. More... | |
virtual QIODevice * | GetStandardErrorStream (void)=0 |
Returns the standard error stream for the program if the kMSStdErr flag was passed to the constructor. More... | |
virtual void | Signal (MythSignal)=0 |
Sends the selected signal to the program. More... | |
virtual int | GetExitCode (void) const =0 |
returns the exit code, if any, that the program returned. More... | |
Static Public Member Functions | |
static MythSystem * | Create (const QStringList &args, uint flags=kMSNone, const QString &startPath=QString(), Priority cpuPriority=kInheritPriority, Priority diskPriority=kInheritPriority) |
static MythSystem * | Create (const QString &args, uint flags=kMSNone, const QString &startPath=QString(), Priority cpuPriority=kInheritPriority, Priority diskPriority=kInheritPriority) |
Protected Member Functions | |
MythSystem ()=default | |
class for managing sub-processes.
This is a hopefully simple interface for managing sub-processes.
The general usage is: { QScopedPointer sys(MythSystem::Create("touch /tmp/i.am.legend")); }
Definition at line 80 of file mythsystem.h.
enum MythSystem::Priority : std::uint8_t |
Priorities that can be used for cpu and disk usage of child process.
Definition at line 84 of file mythsystem.h.
|
virtualdefault |
|
delete |
|
protecteddefault |
|
static |
Definition at line 205 of file mythsystem.cpp.
Referenced by CheckRecordings(), Create(), MusicMetadata::getAlbumArtFile(), MainServer::HandleMusicCalcTrackLen(), MainServer::HandleMusicFindAlbumArt(), MainServer::HandleMusicFindLyrics(), MainServer::HandleMusicTagChangeImage(), MainServer::HandleMusicTagGetImage(), MainServer::HandleMusicTagUpdateVolatile(), MainServer::HandleScanMusic(), and SubtitleCodec().
|
static |
Definition at line 216 of file mythsystem.cpp.
|
delete |
|
pure virtual |
Returns the flags passed to the constructor.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Returns the starting path of the program.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Return the CPU Priority of the program.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Return the Disk Priority of the program.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Blocks until child process is collected or timeout reached.
If the timeout is not provided or a timeout of 0 is provided this will block until the sub-program exits.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Returns the standard input stream for the program if the kMSStdIn flag was passed to the constructor.
Note: The stream this returns is already open.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Returns the standard output stream for the program if the kMSStdOut flag was passed to the constructor.
Note: The stream this returns is already open.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Returns the standard error stream for the program if the kMSStdErr flag was passed to the constructor.
Note: The stream this returns is already open.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
Sends the selected signal to the program.
Implemented in MythSystemLegacyWrapper.
|
pure virtual |
returns the exit code, if any, that the program returned.
Returns -1 if the program exited without exit code. Returns -2 if the program has not yet been collected. Returns an exit code 0..255 if the program exited with exit code.
Implemented in MythSystemLegacyWrapper.