Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ProcessInvoker Class Reference

#include </home/clem/local/src/opie/noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.h>

Collaboration diagram for ProcessInvoker:

Collaboration graph
[legend]
List of all members.

Signals

void start (int, QStringList)
void finish (QString, int)

Public Member Functions

bool run ()
bool run (const QString &args)
void terminate ()
void terminate (pid_t pid)
void kill ()
void kill (pid_t pid)
void setCommand (const QString &command)
void setArguments (const QStringList &arglist)
void setArguments (const QString &arguments)
void addArgument (const QString &argument)
void addArguments (const QString &arguments)
void addArguments (const QStringList &arglist)
void setRunning (int pid)
void setNotify (bool enable=true)
bool isRunning ()
void notifyFinish (int status, bool success=true)

Static Public Member Functions

static ProcessInvokergetInstance ()

Public Attributes

pid_t m_child

Private Slots

void readOutputs ()

Private Member Functions

 ProcessInvoker ()
 ProcessInvoker (const ProcessInvoker &)
ProcessInvokeroperator= (const ProcessInvoker &)
 ~ProcessInvoker ()
bool openPipe ()
void closePipe (int fd[]=NULL, int n=2)
void notifyStatus (const QString &result, int code)
void workerProc ()

Private Attributes

QTimer * m_pTimer
QStringList m_arguments
bool m_isRunning
bool m_isNotify
Sigfuncm_defChildHandler
int m_stdfd [2]
int m_errfd [2]
int m_maxfdp1

Friends

class Dummy

Classes

class  Dummy

Constructor & Destructor Documentation

ProcessInvoker::ProcessInvoker  )  [private]
 

Definition at line 42 of file ProcessInvoker.cpp.

References m_child, m_defChildHandler, m_errfd, m_isRunning, m_pTimer, m_stdfd, and readOutputs().

ProcessInvoker::ProcessInvoker const ProcessInvoker  )  [private]
 

ProcessInvoker::~ProcessInvoker  )  [private]
 

Definition at line 55 of file ProcessInvoker.cpp.

References qDebug().


Member Function Documentation

void ProcessInvoker::addArgument const QString argument  )  [inline]
 

Definition at line 53 of file ProcessInvoker.h.

References QValueList< T >::append(), and m_arguments.

Referenced by addArguments(), and setCommand().

void ProcessInvoker::addArguments const QStringList arglist  )  [inline]
 

Definition at line 62 of file ProcessInvoker.h.

References addArgument(), QValueList< T >::begin(), and QValueList< T >::end().

void ProcessInvoker::addArguments const QString arguments  )  [inline]
 

Definition at line 56 of file ProcessInvoker.h.

References StringParser::split().

void ProcessInvoker::closePipe int  fd[] = NULL,
int  n = 2
[private]
 

Definition at line 81 of file ProcessInvoker.cpp.

References m_errfd, m_stdfd, and NULL.

Referenced by openPipe(), readOutputs(), run(), and workerProc().

void ProcessInvoker::finish QString  ,
int 
[signal]
 

Referenced by notifyFinish().

static ProcessInvoker& ProcessInvoker::getInstance  )  [inline, static]
 

Definition at line 30 of file ProcessInvoker.h.

Referenced by ExecLnk::execute().

bool ProcessInvoker::isRunning  )  [inline]
 

Definition at line 74 of file ProcessInvoker.h.

References m_isRunning.

void ProcessInvoker::kill pid_t  pid  ) 
 

Definition at line 202 of file ProcessInvoker.cpp.

References kill().

void ProcessInvoker::kill  ) 
 

Definition at line 195 of file ProcessInvoker.cpp.

References m_child, and m_isRunning.

Referenced by kill(), and terminate().

void ProcessInvoker::notifyFinish int  status,
bool  success = true
 

Definition at line 347 of file ProcessInvoker.cpp.

References code, finish(), m_child, m_defChildHandler, m_isNotify, m_isRunning, notifyStatus(), qWarning(), SC_CHANNEL, setNotify(), setSignalHandler(), and stopped.

Referenced by childHandler(), and run().

void ProcessInvoker::notifyStatus const QString result,
int  code
[private]
 

Definition at line 391 of file ProcessInvoker.cpp.

References QString::append(), message, QString::number(), and Global::statusMessage().

Referenced by notifyFinish(), and run().

bool ProcessInvoker::openPipe  )  [private]
 

Definition at line 60 of file ProcessInvoker.cpp.

References closePipe(), m_errfd, m_maxfdp1, and m_stdfd.

Referenced by run().

ProcessInvoker& ProcessInvoker::operator= const ProcessInvoker  )  [private]
 

void ProcessInvoker::readOutputs  )  [private, slot]
 

Definition at line 265 of file ProcessInvoker.cpp.

References buf, closePipe(), IO_WriteOnly, m_child, m_errfd, m_maxfdp1, m_pTimer, m_stdfd, NULL, qDebug(), SC_CHANNEL, and QDataStream::writeRawBytes().

Referenced by ProcessInvoker(), and run().

bool ProcessInvoker::run const QString args  ) 
 

Definition at line 104 of file ProcessInvoker.cpp.

References run(), setArguments(), and StringParser::split().

bool ProcessInvoker::run  ) 
 

Definition at line 111 of file ProcessInvoker.cpp.

References QValueList< T >::begin(), childHandler(), closePipe(), QValueList< T >::end(), QValueList< T >::isEmpty(), m_arguments, m_child, m_defChildHandler, m_isNotify, m_isRunning, m_pTimer, notifyFinish(), notifyStatus(), NULL, openPipe(), qDebug(), readOutputs(), SC_CHANNEL, setSignalHandler(), start(), and workerProc().

Referenced by ExecLnk::execute(), and run().

void ProcessInvoker::setArguments const QString arguments  )  [inline]
 

Definition at line 49 of file ProcessInvoker.h.

References setArguments(), and StringParser::split().

void ProcessInvoker::setArguments const QStringList arglist  )  [inline]
 

Definition at line 46 of file ProcessInvoker.h.

References m_arguments.

Referenced by ExecLnk::execute(), run(), and setArguments().

void ProcessInvoker::setCommand const QString command  )  [inline]
 

Definition at line 42 of file ProcessInvoker.h.

References addArgument(), QValueList< T >::clear(), and m_arguments.

void ProcessInvoker::setNotify bool  enable = true  )  [inline]
 

Definition at line 70 of file ProcessInvoker.h.

References m_isNotify.

Referenced by ExecLnk::execute(), and notifyFinish().

void ProcessInvoker::setRunning int  pid  ) 
 

Definition at line 98 of file ProcessInvoker.cpp.

References m_child, and m_isRunning.

void ProcessInvoker::start int  ,
QStringList 
[signal]
 

Referenced by run().

void ProcessInvoker::terminate pid_t  pid  ) 
 

Definition at line 190 of file ProcessInvoker.cpp.

References kill().

void ProcessInvoker::terminate  ) 
 

Definition at line 183 of file ProcessInvoker.cpp.

References m_child, and m_isRunning.

void ProcessInvoker::workerProc  )  [private]
 

Definition at line 402 of file ProcessInvoker.cpp.

References closePipe(), QValueList< T >::count(), m_arguments, m_errfd, and m_stdfd.

Referenced by run().


Friends And Related Function Documentation

friend class Dummy [friend]
 

Definition at line 81 of file ProcessInvoker.h.


Member Data Documentation

QStringList ProcessInvoker::m_arguments [private]
 

Definition at line 94 of file ProcessInvoker.h.

Referenced by addArgument(), run(), setArguments(), setCommand(), and workerProc().

pid_t ProcessInvoker::m_child
 

Definition at line 79 of file ProcessInvoker.h.

Referenced by childHandler(), kill(), notifyFinish(), ProcessInvoker(), readOutputs(), run(), setRunning(), and terminate().

Sigfunc* ProcessInvoker::m_defChildHandler [private]
 

Definition at line 99 of file ProcessInvoker.h.

Referenced by notifyFinish(), ProcessInvoker(), and run().

int ProcessInvoker::m_errfd[2] [private]
 

Definition at line 102 of file ProcessInvoker.h.

Referenced by closePipe(), openPipe(), ProcessInvoker(), readOutputs(), and workerProc().

bool ProcessInvoker::m_isNotify [private]
 

Definition at line 97 of file ProcessInvoker.h.

Referenced by notifyFinish(), run(), and setNotify().

bool ProcessInvoker::m_isRunning [private]
 

Definition at line 96 of file ProcessInvoker.h.

Referenced by isRunning(), kill(), notifyFinish(), ProcessInvoker(), run(), setRunning(), and terminate().

int ProcessInvoker::m_maxfdp1 [private]
 

Definition at line 103 of file ProcessInvoker.h.

Referenced by openPipe(), and readOutputs().

QTimer* ProcessInvoker::m_pTimer [private]
 

Definition at line 93 of file ProcessInvoker.h.

Referenced by ProcessInvoker(), readOutputs(), and run().

int ProcessInvoker::m_stdfd[2] [private]
 

Definition at line 101 of file ProcessInvoker.h.

Referenced by closePipe(), openPipe(), ProcessInvoker(), readOutputs(), and workerProc().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:45:33 2005 for OPIE by  doxygen 1.4.2