Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::G::ChildWatchSignal Class Reference

A child watch signal class. More...

`#include <xfc/main.hh>`

List of all members.

## Public Types

- typedef sigc::slot< void,
  GPid, int > SlotType
    Function signature for handlers connected to this signal.

## Public Member Functions

- sigc::connection connect (const SlotType &slot, GPid pid, int priority=PRIORITY_DEFAULT)
    Sets a callback slot to be called when the child indicated by pid exits, at a default priority, G::PRIORITY_DEFAULT.

## Detailed Description

A child watch signal class.

Slots connected to the ChildWatchSignal are called when the child indicated by pid exits, at a default priority, G_PRIORITY_DEFAULT. ChildWatchSignal is a convenience class that lets you connect a child watch source to the default main context. This is equivalent to creating a ChildWatchSource for the default main context and connecting a slot to it. If your using a different context, for example, inside a thread, use a ChildWatchSource.

## Member Function Documentation

sigc::connection Xfc::G::ChildWatchSignal::connect | ( | const SlotType & | slot,
|  | GPid | pid,
|  | int | priority = `PRIORITY_DEFAULT`
| ) |

Sets a callback slot to be called when the child indicated by pid exits, at a default priority, G::PRIORITY_DEFAULT.

Parameters:

  | slot | The sigc::slot to call periodically.
  | pid | The process id of a child process to watch.
  | priority | The priority of the idle source.

Returns:
  A sigc::connection object that can be used to break or alter the connection.

Note that on platforms where GPid must be explicitely closed pid must not be closed while the source is still active (see G::Spawn::close_pid()). Typically, you will want to call (see G::Spawn::close_pid()) in the callback slot for the source.

Typically the priority will be in the range between G::PRIORITY_DEFAULT_IDLE and G::PRIORITY_HIGH_IDLE.

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

- libXFCcore/xfc/glib/main.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3