34#ifndef BLOCXX_PROCESS_HPP_INCLUDE_GUARD_
35#define BLOCXX_PROCESS_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
195 void repr(
int & rep1,
int & rep2)
const;
242 ETerminationSelectionFlag terminationSelectionFlag = E_TERMINATE_PROCESS_GROUP);
266 void waitCloseTerm(
float wait_initial,
float wait_close,
float wait_term);
269 bool terminatesWithin(
const Timeout& wait_time);
273 bool terminateByMessage(
const Timeout& waitTime);
274 bool killProcess(
const Timeout& waitTime, ETerminationSelectionFlag terminationSelectionFlag);
276 bool killWait(
const Timeout& wait_time,
int sig,
char const * signame, ETerminationSelectionFlag terminationSelectionFlag);
#define BLOCXX_DECLARE_EXCEPTION(NAME)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
bool exitTerminated() const
String toString() const
Get a string representation of the status suitable for debugging or logging.
bool terminatedSuccessfully() const
bool signalTerminated() const
Status(ProcId wpid, int status)
int getPOSIXwaitpidStatus() const
Get the result from waitpid()
void repr(int &rep1, int &rep2) const
ETerminationSelectionFlag
@ E_TERMINATE_PROCESS_ONLY
The process will be terminated.
@ E_TERMINATE_PROCESS_GROUP
The process and any descendent processes which are in the process group will be terminated.
Process(Process const &)
Copying not allowed (private)
Process(UnnamedPipeRef const &in, UnnamedPipeRef const &out, UnnamedPipeRef const &err, ProcId pid)
UnnamedPipeRef out() const
Stdout for the child process.
ProcId pid() const
Process ID for the child process.
void operator=(Process const &)
Assignment not allowed (private)
void release()
Releases ownership of the ProcId and UnnamedPipes held by this object.
UnnamedPipeRef in() const
Stdin for the child process.
UnnamedPipeRef err() const
Stderr for the child process.
Abstract interface for abstracting details of dealing with a process.
virtual Process::Status pollStatus(ProcId pid)=0
virtual int kill(ProcId pid, int sig)=0
Sends signal sig to process pid.
This String class is an abstract data type that represents as NULL terminated string of characters.
A timeout can be absolute, which means that it will happen at the specified DateTime.
static Timeout relative(float seconds)
IntrusiveReference< UnnamedPipe > UnnamedPipeRef
IntrusiveReference< ProcessImpl > ProcessImplRef