E-MailRelay
Public Member Functions | List of all members
G::NewProcessWaitFuture Class Reference

A class that holds the parameters and the results of a waitpid() system call. More...

#include <gnewprocess.h>

Public Member Functions

 NewProcessWaitFuture ()
 Default constructor for an object where run() does nothing and get() returns zero. More...
 
 NewProcessWaitFuture (pid_t pid, int fd=-1)
 Constructor taking a posix process-id and optional readable file descriptor. More...
 
 NewProcessWaitFuture (HANDLE hprocess, HANDLE hpipe, int)
 Constructor taking process and pipe handles. More...
 
NewProcessWaitFuture & run ()
 Waits for the process identified by the constructor parameter to exit. More...
 
int get ()
 Returns the result of the run() as either the process exit code or as a thrown exception. More...
 
std::string output ()
 Returns the first bit of child-process output. More...
 

Detailed Description

A class that holds the parameters and the results of a waitpid() system call.

The run() method can be run from a worker thread and the results collected by the main thread using get() once the worker thread has signalled that it has finished. The signalling mechanism is outside the scope of this class.

Definition at line 144 of file gnewprocess.h.

Constructor & Destructor Documentation

G::NewProcessWaitFuture::NewProcessWaitFuture ( )

Default constructor for an object where run() does nothing and get() returns zero.

Definition at line 342 of file gnewprocess_unix.cpp.

G::NewProcessWaitFuture::NewProcessWaitFuture ( pid_t  pid,
int  fd = -1 
)
explicit

Constructor taking a posix process-id and optional readable file descriptor.

Definition at line 353 of file gnewprocess_unix.cpp.

G::NewProcessWaitFuture::NewProcessWaitFuture ( HANDLE  hprocess,
HANDLE  hpipe,
int   
)

Constructor taking process and pipe handles.

Used in the windows implementation.

Member Function Documentation

int G::NewProcessWaitFuture::get ( )

Returns the result of the run() as either the process exit code or as a thrown exception.

Typically called by the main thread after the run() worker thread has signalled its completion.

Definition at line 415 of file gnewprocess_unix.cpp.

std::string G::NewProcessWaitFuture::output ( )

Returns the first bit of child-process output.

Used after get().

Definition at line 438 of file gnewprocess_unix.cpp.

G::NewProcessWaitFuture & G::NewProcessWaitFuture::run ( )

Waits for the process identified by the constructor parameter to exit.

Returns *this. This method can be called from a separate worker thread.

Definition at line 365 of file gnewprocess_unix.cpp.


The documentation for this class was generated from the following files: