VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 (HANDLE hprocess)
 Constructor taking a process handle.
 
 NewProcessWaitFuture (pid_t pid, int fd=-1)
 Constructor taking a posix process-id and optional readable file descriptor. More...
 
NewProcessWaitFuturerun ()
 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 130 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 312 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 323 of file gnewprocess_unix.cpp.

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 385 of file gnewprocess_unix.cpp.

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

Returns the first bit of child-process output.

Used after get().

Definition at line 408 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 335 of file gnewprocess_unix.cpp.


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