rutz::exec_pipe Class Reference

An exception-safe wrapper around a pipe-fork-exec sequence. More...

#include <rutz/pipe.h>

Inheritance diagram for rutz::exec_pipe:
Inheritance graph
[legend]
Collaboration diagram for rutz::exec_pipe:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 exec_pipe (const char *m, char *const *argv)
 Set up a pipe to a child process with the given argv array.
 exec_pipe (const char *m, const char *argv0,...)
 Set up a pipe to a child process with the given list of args.
 ~exec_pipe () throw ()
 Destructor cleans up child process and the pipe's file descriptors.
std::iostream & stream () throw ()
 Get the stream that is linked to the child process.
void close ()
 Close the underlying stream AND the underlying file descriptor.
int exit_status () throw ()
 Wait for child process to complete, return 0 if all is OK, -1 if error.

Detailed Description

An exception-safe wrapper around a pipe-fork-exec sequence.

Definition at line 131 of file pipe.h.


Constructor & Destructor Documentation

rutz::exec_pipe::exec_pipe ( const char *  m,
char *const *  argv 
)

Set up a pipe to a child process with the given argv array.

The mode should be "r" if the parent is reading, and "w" if the parent is writing. NOTE that the argv array MUST be NULL-terminated!

Definition at line 225 of file pipe.cc.

rutz::exec_pipe::exec_pipe ( const char *  m,
const char *  argv0,
  ... 
)

Set up a pipe to a child process with the given list of args.

The mode should be "r" if the parent is reading, and "w" if the parent is writing. NOTE that the variable length argument list MUST NULL-terminated!

Definition at line 234 of file pipe.cc.

rutz::exec_pipe::~exec_pipe (  )  throw ()

Destructor cleans up child process and the pipe's file descriptors.

Definition at line 251 of file pipe.cc.


Member Function Documentation

void rutz::exec_pipe::close ( void   ) 

Close the underlying stream AND the underlying file descriptor.

Definition at line 262 of file pipe.cc.

References rutz::stdiostream::close().

int rutz::exec_pipe::exit_status (  )  throw ()

Wait for child process to complete, return 0 if all is OK, -1 if error.

Definition at line 272 of file pipe.cc.

References rutz::child_process::wait().

std::iostream & rutz::exec_pipe::stream (  )  throw ()

Get the stream that is linked to the child process.

Definition at line 256 of file pipe.cc.

Referenced by numCpus().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:44 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3