Main Page glibmm Namespaces Book

# The Main Event Loop

Manages all available sources of events. More...

## Classes
class | Glib::PollFD
class | Glib::SignalTimeout
class | Glib::SignalIdle
class | Glib::SignalIO
class | Glib::SignalChildWatch
class | Glib::MainContext
| Main context. More...
class | Glib::MainLoop
class | Glib::Source
class | Glib::TimeoutSource
class | Glib::IdleSource
class | Glib::IOSource
## Enumerations
enum | Glib::IOCondition { Glib::IO_IN, Glib::IO_OUT, Glib::IO_PRI, Glib::IO_ERR, Glib::IO_HUP, Glib::IO_NVAL }
| A bitwise combination representing an I/O condition to watch for on an event source. More...
## Functions
IOCondition | Glib::operator| (IOCondition lhs, IOCondition rhs)
IOCondition | Glib::operator& (IOCondition lhs, IOCondition rhs)
IOCondition | Glib::operator^ (IOCondition lhs, IOCondition rhs)
IOCondition | Glib::operator~ (IOCondition flags)
IOCondition& | Glib::operator|= (IOCondition& lhs, IOCondition rhs)
IOCondition& | Glib::operator&= (IOCondition& lhs, IOCondition rhs)
IOCondition& | Glib::operator^= (IOCondition& lhs, IOCondition rhs)
SignalTimeout | Glib::signal_timeout ()
| Convenience timeout signal.
SignalIdle | Glib::signal_idle ()
| Convenience idle signal.
SignalIO | Glib::signal_io ()
| Convenience I/O signal.
SignalChildWatch | Glib::signal_child_watch ()
| Convenience child watch signal.
Glib::RefPtr<MainContext> | Glib::MainContext::wrap (GMainContext* gobject, bool take_copy=false)
Glib::RefPtr<MainLoop> | Glib::MainLoop::wrap (GMainLoop* gobject, bool take_copy=false)

## Detailed Description

Manages all available sources of events.

## Enumeration Type Documentation

enum Glib::IOCondition

A bitwise combination representing an I/O condition to watch for on an event source.

The flags correspond to those used by the `poll()` system call on UNIX (see `man 2 poll`). To test for individual flags, do something like this:

     if((condition & Glib::IO_OUT) != 0)
       do_some_output();

Bitwise operators:
  `IOCondition operator|(IOCondition, IOCondition)`
  `IOCondition operator&(IOCondition, IOCondition)`
  `IOCondition operator^(IOCondition, IOCondition)`
  `IOCondition operator~(IOCondition)`
  `IOCondition& operator|=(IOCondition&, IOCondition)`
  `IOCondition& operator&=(IOCondition&, IOCondition)`
  `IOCondition& operator^=(IOCondition&, IOCondition)`

Enumerator:

  IO_IN | There is data to read.
  IO_OUT | Data can be written (without blocking).
  IO_PRI | There is urgent data to read.
  IO_ERR | Error condition.
  IO_HUP | Hung up (the connection has been broken, usually for pipes and sockets).
  IO_NVAL | Invalid request. The file descriptor is not open.

## Function Documentation

IOCondition Glib::operator & | ( | IOCondition | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition& Glib::operator &= | ( | IOCondition & | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition Glib::operator^ | ( | IOCondition | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition& Glib::operator^= | ( | IOCondition & | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition Glib::operator| | ( | IOCondition | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition& Glib::operator|= | ( | IOCondition & | lhs,
|  | IOCondition | rhs |
| ) |  |  | `[inline]`

IOCondition Glib::operator~ | ( | IOCondition | flags | ) | `[inline]`

SignalChildWatch Glib::signal_child_watch | ( |  | ) |

Convenience child watch signal.

Returns:
  A signal proxy; you want to use SignalChildWatch::connect().

SignalIdle Glib::signal_idle | ( |  | ) |

Convenience idle signal.

Returns:
  A signal proxy; you want to use SignalIdle::connect().

Examples:
  thread/dispatcher.cc.

SignalIO Glib::signal_io | ( |  | ) |

Convenience I/O signal.

Returns:
  A signal proxy; you want to use SignalIO::connect().

SignalTimeout Glib::signal_timeout | ( |  | ) |

Convenience timeout signal.

Returns:
  A signal proxy; you want to use SignalTimeout::connect().

Glib::RefPtr<MainLoop> wrap | ( | GMainLoop * | gobject,
|  | bool | take_copy = `false` |
| ) |  |  | `[related, inherited]`

Glib::RefPtr<MainContext> wrap | ( | GMainContext * | gobject,
|  | bool | take_copy = `false` |
| ) |  |  | `[related, inherited]`