In file pipeexec/pipe_exec.hh:

class prog_exec

system equivalent

Inheritance:


Public Methods

explicit prog_exec (const char* cmd)
Constructor
virtual ~prog_exec ()
Destuctor
virtual bool operator! ()
Returns true on error
virtual const char* cmd () const
Returns the comand string
virtual int pid () const
Return the child process ID
virtual int wait (int* stat_loc = 0, bool poll = false)
Wait for child to terminate (returns exit code) If poll is true, the method will not block and return 0 in case the child process is still alive
virtual int wait (double timeout, int* stat_loc = 0)
Wait for child to terminate with timeout
virtual bool kill (int sig)
Send a signal to the child

Protected Methods

prog_exec ()
Default constructor
virtual bool parse (const char* cmd)
parse command line
virtual void setcmd (const char* cmd)
set the command
virtual void setpid (int pid)
set the pid
virtual const char* path () const
Return path
virtual char* const* args () const
Return args

Documentation

Prog_exec. Starts a child process with fork and executes the string cmd with execlp.

explicit prog_exec(const char* cmd)
Constructor. Sets up the pipes and starts the child process.

virtual ~prog_exec()
Destuctor. Sends a kill signal to the child

virtual bool operator!()
Returns true on error

virtual const char* cmd() const
Returns the comand string

virtual int pid() const
Return the child process ID

virtual int wait(int* stat_loc = 0, bool poll = false)
Wait for child to terminate (returns exit code) If poll is true, the method will not block and return 0 in case the child process is still alive. This method will return the same as waitpid and set the return status if stat_loc is non-zero.

virtual int wait(double timeout, int* stat_loc = 0)
Wait for child to terminate with timeout. If the time expires and the child process is still alive, the mothod will return 0. Otherwise, this method will return the same as waitpid and set the return status if stat_loc is non-zero. The timeout is in seconds. A timeout of 0 is equal to polling and a negative timeout will block.

virtual bool kill(int sig)
Send a signal to the child

prog_exec()
Default constructor

virtual bool parse(const char* cmd)
parse command line

virtual void setcmd(const char* cmd)
set the command

virtual void setpid(int pid)
set the pid

virtual const char* path() const
Return path

virtual char* const* args() const
Return args


Direct child classes:
pipe_exec

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++