Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

SUEChildWaitAgent Class Reference

Child Wait Agent. More...

#include <sue_wait.hpp>

Inheritance diagram for SUEChildWaitAgent:

Inheritance graph
[legend]
Collaboration diagram for SUEChildWaitAgent:

Collaboration graph
[legend]
List of all members.

Public Methods

 SUEChildWaitAgent ()
 Constructor.

virtual ~SUEChildWaitAgent ()
 Destructor.

void Register (SUEEventSelector *a_selector)
 Register it with the selector.

void Unregister ()
 Remove from the selector.

void RegisterChildHandler (SUEChildHandler *h)
 Add a child handler.

void RemoveChildHandler (SUEChildHandler *h)
 Remove a previously added child handler.


Detailed Description

Child Wait Agent.

This object allows the mechanism of SUE child handling support to work. It installs a handler for the SIGCHLD signal, and then searches for the approproate handler of SUEChildHandler type, if any, to call their respective methods.

Note:
Perhaps you need only one object of this class in your application, but you can create more, register them all with your selector and they will work for you, altough it just slows down your application a bit.
Warning:
Register this object with your selector BEFORE launching any children! or else the mechanism could work inaccurate. It is also better not to launch any handled children before the main loop is started, since it raises the risk of a race condition
Examples:

children.cpp.


Constructor & Destructor Documentation

SUEChildWaitAgent::SUEChildWaitAgent  
 

Constructor.

virtual SUEChildWaitAgent::~SUEChildWaitAgent   [virtual]
 

Destructor.


Member Function Documentation

void SUEChildWaitAgent::Register SUEEventSelector   a_selector
 

Register it with the selector.

Examples:
children.cpp.

void SUEChildWaitAgent::RegisterChildHandler SUEChildHandler   h
 

Add a child handler.

Note:
The SUEChildHandler does it itself, so there's nothing to worry about; normally, you never need this method.

void SUEChildWaitAgent::RemoveChildHandler SUEChildHandler   h
 

Remove a previously added child handler.

Note:
Exited children's handlers are removed (and deleted) automatically, so this method is rarely needed: only in case you fro some reason don't want to handle a particular child anymore. For example, if you want to change the handling object.

void SUEChildWaitAgent::Unregister  
 

Remove from the selector.


The documentation for this class was generated from the following file:
Generated on Fri Feb 27 13:17:26 2004 for SUE Library by doxygen1.2.18