Wefts::OSProcessPthread Class Reference

#include <wefts_proc_pthread.h>

Inheritance diagram for Wefts::OSProcessPthread:

Inheritance graph
[legend]
Collaboration diagram for Wefts::OSProcessPthread:

Collaboration graph
[legend]
List of all members.

Detailed Description

Representation of subprocesses on the platform.

This class encapsulates threadsafe subprocess handling on the current platform. It provides support to spawn a child of the process, access its stdin, stdout and stderr file handle, test it's status and eventually wait for its termination.

The encapsulation is made so that the child process can be referenced to the thread that spawned it; if the father thread is cancelled, so the child process is.


Public Member Functions

 OSProcessPthread ()
 ~OSProcessPthread ()
virtual bool running ()
virtual bool wait (const double seconds=-1.0)
virtual bool start (const std::string process, bool useShell=false, bool usePath=true)
virtual bool stop ()
virtual bool getProcessValue (int &retvalue) const
virtual file_size_t getProcessId () const
virtual int write (const void *data, const int size, const double seconds=-1.0)
virtual int read (void *data, const int size, const double seconds=-1.0)
virtual int readStdErr (void *data, const int size, const double seconds=-1.0)
virtual void mergeStdErr ()
virtual void detach ()
virtual void sinkInput ()
virtual void sinkOutput ()
virtual void sinkError ()
virtual bool closeRead ()
virtual bool closeWrite ()
virtual bool closeStdErr ()
virtual void handleCleanup (int code, void *caller=0)

Private Member Functions

void detachUnlocked ()

Static Private Member Functions

int parametrize (char *dese, const char *src)
char ** argvize (char *dest, int size)

Private Attributes

pthread_mutex_t m_mutex
pid_t m_pid
int m_childIn
int m_childOut
int m_childErr
bool m_sinkIn
bool m_sinkOut
bool m_sinkErr


Constructor & Destructor Documentation

Wefts::OSProcessPthread::OSProcessPthread  ) 
 

Wefts::OSProcessPthread::~OSProcessPthread  ) 
 


Member Function Documentation

char ** Wefts::OSProcessPthread::argvize char *  dest,
int  size
[static, private]
 

bool Wefts::OSProcessPthread::closeRead  )  [virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::closeStdErr  )  [virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::closeWrite  )  [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::detach  )  [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::detachUnlocked  )  [private]
 

file_size_t Wefts::OSProcessPthread::getProcessId  )  const [virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::getProcessValue int &  retvalue  )  const [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::handleCleanup int  code,
void *  caller = 0
[virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::mergeStdErr  )  [virtual]
 

Implements Wefts::OSProcessBase.

int Wefts::OSProcessPthread::parametrize char *  dese,
const char *  src
[static, private]
 

int Wefts::OSProcessPthread::read void *  data,
const int  size,
const double  seconds = -1.0
[virtual]
 

Implements Wefts::OSProcessBase.

int Wefts::OSProcessPthread::readStdErr void *  data,
const int  size,
const double  seconds = -1.0
[virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::running  )  [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::sinkError  )  [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::sinkInput  )  [virtual]
 

Implements Wefts::OSProcessBase.

void Wefts::OSProcessPthread::sinkOutput  )  [virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::start const std::string  process,
bool  useShell = false,
bool  usePath = true
[virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::stop  )  [virtual]
 

Implements Wefts::OSProcessBase.

bool Wefts::OSProcessPthread::wait const double  seconds = -1.0  )  [virtual]
 

Implements Wefts::OSProcessBase.

int Wefts::OSProcessPthread::write const void *  data,
const int  size,
const double  seconds = -1.0
[virtual]
 

Implements Wefts::OSProcessBase.


Member Data Documentation

int Wefts::OSProcessPthread::m_childErr [private]
 

int Wefts::OSProcessPthread::m_childIn [private]
 

int Wefts::OSProcessPthread::m_childOut [private]
 

pthread_mutex_t Wefts::OSProcessPthread::m_mutex [private]
 

pid_t Wefts::OSProcessPthread::m_pid [private]
 

bool Wefts::OSProcessPthread::m_sinkErr [private]
 

bool Wefts::OSProcessPthread::m_sinkIn [private]
 

bool Wefts::OSProcessPthread::m_sinkOut [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 14:57:03 2004 for Wefts by doxygen 1.3.7