Tinkercell::ProcessThread Class Reference

This class is used to run a process (command + args) as a separate thread as a separate thread. More...

#include <CThread.h>

Public Member Functions

 ProcessThread (const QString &, const QString &, QWidget *main)
 constructor -- used to initialize the main window, the command name and the args for the command
virtual QString output () const
 get the results (output stream) from the process
virtual QString errors () const
 get the errors (error stream) from the process
virtual ~ProcessThread ()
 destructor -- free the library that this thread loaded

Static Public Member Functions

static QWidget * dialog (QWidget *, ProcessThread *, const QString &text=QString("Process"), QIcon icon=QIcon())
 creates a dialog that shows the name of the running thread and a button for terminating the thread

Protected Slots

virtual void stopProcess ()
 unload the library (if loaded) and delete it

Protected Member Functions

virtual void run ()
 initializes the function pointers through the main window and then runs the target function

Protected Attributes

QString exe
 the name of the executable
QString args
 the arguments
QString outputStream
 the output from the process
QString errStream
 the error from the process
QProcess process
 Tinkercell's main window.

Detailed Description

This class is used to run a process (command + args) as a separate thread as a separate thread.

Definition at line 48 of file CThread.h.


Constructor & Destructor Documentation

Tinkercell::ProcessThread::ProcessThread ( const QString &  exe,
const QString &  args,
QWidget *  main 
)

constructor -- used to initialize the main window, the command name and the args for the command

Parameters:
QString command
QString arguments
QWidget main window

Definition at line 57 of file CThread.cpp.

References stopProcess().

Tinkercell::ProcessThread::~ProcessThread (  )  [virtual]

destructor -- free the library that this thread loaded

Definition at line 86 of file CThread.cpp.

References stopProcess().


Member Function Documentation

QWidget * Tinkercell::ProcessThread::dialog ( QWidget *  mainWindow,
ProcessThread newThread,
const QString &  text = QString("Process"),
QIcon  icon = QIcon() 
) [static]

creates a dialog that shows the name of the running thread and a button for terminating the thread

Parameters:
QWidget main window
ProcessThread 
QString text to display
QIcon icon to display

Definition at line 28 of file CThread.cpp.

References close().

QString Tinkercell::ProcessThread::errors (  )  const [virtual]

get the errors (error stream) from the process

Returns:
QString output

Definition at line 96 of file CThread.cpp.

References errStream.

QString Tinkercell::ProcessThread::output (  )  const [virtual]

get the results (output stream) from the process

Returns:
QString output

Definition at line 91 of file CThread.cpp.

References outputStream.

void Tinkercell::ProcessThread::run (  )  [protected, virtual]

initializes the function pointers through the main window and then runs the target function

Definition at line 67 of file CThread.cpp.

References args, errStream, exe, outputStream, and process.

void Tinkercell::ProcessThread::stopProcess (  )  [protected, virtual, slot]

unload the library (if loaded) and delete it

Definition at line 80 of file CThread.cpp.

References process.

Referenced by ProcessThread(), and ~ProcessThread().


Field Documentation

QString Tinkercell::ProcessThread::args [protected]

the arguments

Definition at line 80 of file CThread.h.

Referenced by run().

the error from the process

Definition at line 84 of file CThread.h.

Referenced by errors(), and run().

QString Tinkercell::ProcessThread::exe [protected]

the name of the executable

Definition at line 78 of file CThread.h.

Referenced by run().

the output from the process

Definition at line 82 of file CThread.h.

Referenced by output(), and run().

QProcess Tinkercell::ProcessThread::process [protected]

Tinkercell's main window.

Definition at line 86 of file CThread.h.

Referenced by run(), and stopProcess().


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

Generated on Tue Nov 3 23:17:14 2009 for Network Evolution Library by  doxygen 1.6.1