SigCX::Dispatcher Class Reference
[SigC++ Extras]

Dispatcher class. More...

#include <dispatch.h>

Inheritance diagram for SigCX::Dispatcher:

SigCX::SignalDispatcher SigCX::GtkDispatcher SigCX::StandardDispatcher

List of all members.

Public Types

enum  Event {
  Timer, Read, Write, Except,
  Signal, All, Remove, Moved
}
typedef SigC::Slot0
< void > 
Handler
typedef unsigned long HandlerID

Public Member Functions

 Dispatcher ()
virtual ~Dispatcher ()
virtual HandlerID add_input_handler (const Handler &h, int fd)=0
virtual HandlerID add_output_handler (const Handler &h, int fd)=0
virtual HandlerID add_exception_handler (const Handler &h, int fd)=0
virtual HandlerID add_timeout_handler (const Handler &h, const TimeVal &tv)=0
HandlerID add_timeout_handler_msec (const Handler &h, unsigned long tmout)
virtual HandlerID add_signal_handler (const Handler &h, int sig)=0
virtual void remove (HandlerID id)=0
virtual bool run (bool infinite=true)=0
virtual void exit ()=0
virtual void move (Dispatcher &d)=0
virtual bool idle () const =0


Detailed Description

Dispatcher class.

This abstract class defines a generic interface to an event dispatcher.


Member Typedef Documentation

typedef SigC::Slot0<void> SigCX::Dispatcher::Handler

Event handler.

typedef unsigned long SigCX::Dispatcher::HandlerID

Event handler ID.


Member Enumeration Documentation

enum SigCX::Dispatcher::Event

Event types.

Enumerator:
Timer  Timer event.
Read  Data ready for reading.
Write  IO channel ready for writing.
Except  IO channel exception.
Signal  Signal.
All  All events.
Remove  Handler remove event.
Moved  Handler move event.


Constructor & Destructor Documentation

SigCX::Dispatcher::Dispatcher (  )  [inline]

Constructor.

virtual SigCX::Dispatcher::~Dispatcher (  )  [virtual]

Destructor.


Member Function Documentation

virtual HandlerID SigCX::Dispatcher::add_input_handler ( const Handler h,
int  fd 
) [pure virtual]

Add input handler.

The handler h is invoked when data is ready for reading from fd.

Parameters:
h The input handler.
fd File descriptor.

virtual HandlerID SigCX::Dispatcher::add_output_handler ( const Handler h,
int  fd 
) [pure virtual]

Add output handler.

The handler h is invoked when fd is ready for writing.

Parameters:
h The input handler.
fd File descriptor.

virtual HandlerID SigCX::Dispatcher::add_exception_handler ( const Handler h,
int  fd 
) [pure virtual]

Add exception handler.

The handler h is invoked when an exception occurs on fd.

Parameters:
h The input handler.
fd File descriptor.

virtual HandlerID SigCX::Dispatcher::add_timeout_handler ( const Handler h,
const TimeVal tv 
) [pure virtual]

Add timeout handler.

The handler h is invoked when the time specified by tv has passed.

Parameters:
h The input handler.
tv TimeVal timeout.

HandlerID SigCX::Dispatcher::add_timeout_handler_msec ( const Handler h,
unsigned long  tmout 
) [inline]

Add timeout handler.

The handler h is invoked when the time specified by tv has passed.

Parameters:
h The input handler.
tmout timeout in milliseconds.

virtual HandlerID SigCX::Dispatcher::add_signal_handler ( const Handler h,
int  sig 
) [pure virtual]

Add signal handler.

The handler h is invoked when the signal sig is received by the program.

virtual void SigCX::Dispatcher::remove ( HandlerID  id  )  [pure virtual]

Remove a handler.

Parameters:
id The ID of the handler.

virtual bool SigCX::Dispatcher::run ( bool  infinite = true  )  [pure virtual]

Run the dispatcher.

Run the dispatcher event loop, receiving events and calling the registered callbacks.

Parameters:
infinite If false, run only one iteration, else run until exit() is called on this dispatcher instance.
Returns:
true if exit() was called.

Implemented in SigCX::StandardDispatcher, and SigCX::GtkDispatcher.

virtual void SigCX::Dispatcher::exit (  )  [pure virtual]

Cause exit of event loop.

Implemented in SigCX::StandardDispatcher, and SigCX::GtkDispatcher.

virtual void SigCX::Dispatcher::move ( Dispatcher d  )  [pure virtual]

Move all callbacks to another dispatcher.

Parameters:
d The dispatcher to move the callbacks to.

Implemented in SigCX::StandardDispatcher, and SigCX::GtkDispatcher.

virtual bool SigCX::Dispatcher::idle (  )  const [pure virtual]

Get idle status.

Returns:
true if the dispatcher is idle.

Implemented in SigCX::StandardDispatcher, and SigCX::GtkDispatcher.


The documentation for this class was generated from the following file:
Generated on Mon Sep 10 06:27:37 2007 for SigCX - SigC++ Extras by  doxygen 1.5.3