Wefts::OSProcessWin Class Reference

#include <wefts_proc_win.h>

Inheritance diagram for Wefts::OSProcessWin:

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

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

 OSProcessWin ()
 ~OSProcessWin ()
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

CRITICAL_SECTION m_mutex
HANDLE m_pid
HANDLE m_childIn
HANDLE m_childOut
HANDLE m_childErr
bool m_sinkIn
bool m_sinkOut
bool m_sinkErr


Constructor & Destructor Documentation

Wefts::OSProcessWin::OSProcessWin  ) 
 

Wefts::OSProcessWin::~OSProcessWin  ) 
 


Member Function Documentation

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

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.

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

Implements Wefts::OSProcessBase.


Member Data Documentation

HANDLE Wefts::OSProcessWin::m_childErr [private]
 

HANDLE Wefts::OSProcessWin::m_childIn [private]
 

HANDLE Wefts::OSProcessWin::m_childOut [private]
 

CRITICAL_SECTION Wefts::OSProcessWin::m_mutex [private]
 

HANDLE Wefts::OSProcessWin::m_pid [private]
 

bool Wefts::OSProcessWin::m_sinkErr [private]
 

bool Wefts::OSProcessWin::m_sinkIn [private]
 

bool Wefts::OSProcessWin::m_sinkOut [private]
 


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