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

OProcessController Class Reference

Used internally by OProcess. More...

#include </home/clem/local/src/opie/noncore/unsupported/libopie/oprocctrl.h>

Collaboration diagram for OProcessController:

Collaboration graph
[legend]
List of all members.

Public Slots

void slotDoHousekeeping (int socket)

Public Member Functions

 OProcessController ()
 ~OProcessController ()
void addOProcess (OProcess *)
void removeOProcess (OProcess *)

Static Public Member Functions

static void theSigCHLDHandler (int signal)
static void setupHandlers ()
static void resetHandlers ()

Static Public Attributes

static OProcessControllertheOProcessController = 0

Private Slots

void delayedChildrenCleanup ()

Private Member Functions

 OProcessController (const OProcessController &)
OProcessControlleroperator= (const OProcessController &)

Private Attributes

int fd [2]
QSocketNotifier * notifier
QValueList< OProcess * > processList
QTimer delayedChildrenCleanupTimer
OProcessControllerPrivate * d

Static Private Attributes

static struct sigaction oldChildHandlerData
static bool handlerSet = false

Detailed Description

Used internally by OProcess.

For internal use only.

Author:
Christian Czezakte <e9025461@student.tuwien.ac.at>
A class for internal use by OProcess only. -- Exactly one instance of this class is generated by the first instance of OProcess that is created (a pointer to it gets stored in theOProcessController ).

This class takes care of the actual (UN*X) signal handling.

Definition at line 51 of file oprocctrl.h.


Constructor & Destructor Documentation

OProcessController::OProcessController  ) 
 

Definition at line 49 of file oprocctrl.cpp.

References assert, delayedChildrenCleanup(), printf, setupHandlers(), and slotDoHousekeeping().

OProcessController::~OProcessController  ) 
 

Definition at line 253 of file oprocctrl.cpp.

References assert, fd, notifier, resetHandlers(), and theOProcessController.

OProcessController::OProcessController const OProcessController  )  [private]
 


Member Function Documentation

void OProcessController::addOProcess OProcess  ) 
 

For internal use only.

Definition at line 109 of file oprocctrl.cpp.

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

Referenced by OProcess::init().

void OProcessController::delayedChildrenCleanup  )  [private, slot]
 

Definition at line 236 of file oprocctrl.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), fd, waitdata::pid, processList, waitdata::status, and write().

Referenced by OProcessController().

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

void OProcessController::removeOProcess OProcess  ) 
 

For internal use only.

Definition at line 119 of file oprocctrl.cpp.

References processList, and QValueList< T >::remove().

Referenced by OProcess::detach(), and OProcess::~OProcess().

void OProcessController::resetHandlers  )  [static]
 

For internal use only.

Definition at line 99 of file oprocctrl.cpp.

References handlerSet, and oldChildHandlerData.

Referenced by ~OProcessController().

void OProcessController::setupHandlers  )  [static]
 

For internal use only.

Definition at line 69 of file oprocctrl.cpp.

References handlerSet, oldChildHandlerData, and theSigCHLDHandler().

Referenced by OProcessController().

void OProcessController::slotDoHousekeeping int  socket  )  [slot]
 

For internal use only.

Definition at line 185 of file oprocctrl.cpp.

References QValueList< T >::begin(), OProcess::Block, delayedChildrenCleanupTimer, QValueList< T >::end(), fd, OProcess::pid(), OProcess::processHasExited(), processList, OProcess::run_mode, OProcess::runs, and OProcess::status.

Referenced by OProcessController().

void OProcessController::theSigCHLDHandler int  signal  )  [static]
 

Automatically called upon SIGCHLD.

Normally you do not need to do anything with this function but if your application needs to disable SIGCHLD for some time for reasons beyond your control, you should call this function afterwards to make sure that no SIGCHLDs where missed.

Definition at line 140 of file oprocctrl.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), fd, oldChildHandlerData, waitdata::pid, processList, waitdata::status, theOProcessController, and write().

Referenced by setupHandlers().


Member Data Documentation

OProcessControllerPrivate* OProcessController::d [private]
 

Definition at line 115 of file oprocctrl.h.

QTimer OProcessController::delayedChildrenCleanupTimer [private]
 

Definition at line 109 of file oprocctrl.h.

Referenced by slotDoHousekeeping().

int OProcessController::fd[2] [private]
 

Definition at line 104 of file oprocctrl.h.

Referenced by delayedChildrenCleanup(), slotDoHousekeeping(), theSigCHLDHandler(), and ~OProcessController().

bool OProcessController::handlerSet = false [static, private]
 

Definition at line 47 of file oprocctrl.cpp.

Referenced by resetHandlers(), and setupHandlers().

QSocketNotifier* OProcessController::notifier [private]
 

Definition at line 105 of file oprocctrl.h.

Referenced by ~OProcessController().

struct sigaction OProcessController::oldChildHandlerData [static, private]
 

Definition at line 106 of file oprocctrl.h.

Referenced by resetHandlers(), setupHandlers(), and theSigCHLDHandler().

QValueList<OProcess*> OProcessController::processList [private]
 

Definition at line 108 of file oprocctrl.h.

Referenced by addOProcess(), delayedChildrenCleanup(), removeOProcess(), slotDoHousekeeping(), and theSigCHLDHandler().

OProcessController * OProcessController::theOProcessController = 0 [static]
 

Only a single instance of this class is allowed at a time, and this static variable is used to track the one instance.

Definition at line 44 of file oprocctrl.cpp.

Referenced by OProcess::detach(), Opie::Core::OProcess::detach(), OProcess::init(), Opie::Core::OProcess::init(), OProcess::start(), Opie::Core::OProcess::start(), theSigCHLDHandler(), OProcess::~OProcess(), Opie::Core::OProcess::~OProcess(), and ~OProcessController().


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