|
JX Application Framework
|
#include <JProcess.h>
Classes | |
| class | Finished |
Public Member Functions | |
| JProcess (const pid_t pid) | |
| ~JProcess () override | |
| pid_t | GetPID () const |
| JError | GetPGID (pid_t *pgid) const |
| void | Quit () |
| void | Kill () |
| void | WaitUntilFinished () |
| bool | IsFinished () const |
| bool | SuccessfulFinish () const |
| bool | GetFinishReason (JChildExitReason *reason, int *result) const |
| bool | GetReturnValue (int *result) const |
| bool | GetTermSignal (int *result) const |
| bool | GetStopSignal (int *result) const |
| JError | SendSignal (const int signal) |
| JError | SendSignalToGroup (const int signal) |
| JError | SetPriority (const int priority) |
| bool | WillDeleteWhenFinished () const |
| void | ShouldDeleteWhenFinished (const bool deleteObj=true) |
| bool | WillQuitAtExit () const |
| void | QuitAtExit (const bool quit=true) |
| bool | WillKillAtExit () const |
| void | KillAtExit (const bool kill=true) |
Public Member Functions inherited from JBroadcaster | |
| JBroadcaster () | |
| virtual | ~JBroadcaster () |
| JBroadcaster & | operator= (const JBroadcaster &source) |
| bool | HasSenders () const |
| JSize | GetSenderCount () const |
| bool | HasRecipients () const |
| JSize | GetRecipientCount () const |
| virtual JString | ToString () const |
| template<class T > | |
| void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Static Public Member Functions | |
| static JError | Create (JProcess **process, const JString &str, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static JError | Create (JProcess **process, const JPtrArray< JString > &argList, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static JError | Create (JProcess **process, const JUtf8Byte *argv[], const JSize size, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static JError | Create (JProcess **process, const JString &workingDirectory, const JString &str, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static JError | Create (JProcess **process, const JString &workingDirectory, const JPtrArray< JString > &argList, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static JError | Create (JProcess **process, const JString &workingDirectory, const JUtf8Byte *argv[], const JSize size, const JExecuteAction toAction=kJIgnoreConnection, int *toFD=nullptr, const JExecuteAction fromAction=kJIgnoreConnection, int *fromFD=nullptr, const JExecuteAction errAction=kJIgnoreConnection, int *errFD=nullptr) |
| static void | CheckForFinishedChild (const bool block) |
Static Public Attributes | |
| static const JUtf8Byte * | kFinished = "Finished::JProcess" |
Additional Inherited Members | |
Protected Member Functions inherited from JBroadcaster | |
| JBroadcaster (const JBroadcaster &source) | |
| void | ListenTo (const JBroadcaster *sender) |
| void | StopListening (const JBroadcaster *sender) |
| void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
| void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
| template<class T > | |
| void | Send (JBroadcaster *recipient, const T &message) |
| template<class T > | |
| void | Broadcast (const T &message) |
| virtual void | Receive (JBroadcaster *sender, const Message &message) |
| void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
| void | BroadcastWithFeedback (Message *message) |
| virtual void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) |
| virtual void | ReceiveGoingAway (JBroadcaster *sender) |
Class to represent a UNIX process. Event loops can call CheckForFinishedChild(false) in order to receive JBroadcaster messages when child processes finish.
| JProcess::JProcess | ( | const pid_t | pid | ) |
|
override |
|
static |
Checks if a child has finished. If one has, an a JProcess object exists for it, then tell it to Broadcast().
|
static |
|
static |
Refer to JExecute() for documentation.
|
static |
|
static |
|
static |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void JProcess::KillAtExit | ( | const bool | kill = true | ) |
|
inline |
| void JProcess::QuitAtExit | ( | const bool | quit = true | ) |
|
inline |
| JError JProcess::SendSignalToGroup | ( | const int | signal | ) |
|
inline |
|
inline |
|
inline |
| void JProcess::WaitUntilFinished | ( | ) |
Block until the child finishes.
|
inline |
| bool JProcess::WillKillAtExit | ( | ) | const |
| bool JProcess::WillQuitAtExit | ( | ) | const |
|
static |