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

FX::FXDispatcher Class Reference

A Dispatcher watches a number of devices and signals for activity and dispatches to the proper function when activity is observed. More...

#include <FXDispatcher.h>

Public Types

enum  { InputNone = 0, InputRead = 1, InputWrite = 2, InputExcept = 4 }
 
enum  {
  DispatchAll = 0xffffffff, DispatchSignals = 0x00000001, DispatchTimers = 0x00000002, DispatchIdle = 0x00000004,
  DispatchInputs = 0x00000008
}
 

Public Member Functions

 FXDispatcher ()
 Construct dispatcher object.
 
virtual FXbool init ()
 Initialize dispatcher.
 
FXbool isInitialized () const
 Is dispatcher initialized.
 
virtual FXTime getTimeout ()
 Return timeout when something needs to happen.
 
virtual FXbool hasSignal (FXint sig)
 Check if dispatcher handles given signal.
 
virtual FXbool addSignal (FXint sig, FXbool async=false)
 Append signal to signal-set.
 
virtual FXbool remSignal (FXint sig)
 Remove signal from signal-set.
 
virtual FXbool remAllSignals ()
 Remvoe all signals.
 
virtual FXbool addHandle (FXInputHandle hnd, FXuint mode=InputRead)
 Append handle hnd to watch-list.
 
virtual FXbool remHandle (FXInputHandle hnd)
 Remove handle hnd from watch-list.
 
virtual FXbool dispatch (FXTime blocking=forever, FXuint flags=DispatchAll)
 Dispatch if something happens within given timeout.
 
virtual FXbool dispatchSignal (FXint sig)
 Dispatch when a signal was fired.
 
virtual FXbool dispatchHandle (FXInputHandle hnd, FXuint mode)
 Dispatch when handle with given mode becomes active.
 
virtual FXbool dispatchTimeout (FXTime due)
 Dispatch when timeout expires.
 
virtual FXbool dispatchIdle ()
 Dispatch when idle.
 
virtual FXbool exit ()
 Exit dispatcher.
 
virtual ~FXDispatcher ()
 Destroy dispatcher object.
 

Protected Member Functions

 FXDispatcher (const FXDispatcher &)
 
FXDispatcheroperator= (const FXDispatcher &)
 

Protected Attributes

FXHandles * handles
 
volatile FXint signotified [64]
 
FXint sigreceived
 
FXint numhandles
 
FXint numwatched
 
FXint numraised
 
FXint current
 
FXbool initialized
 

Static Protected Attributes

static FXDispatcher *volatile sigmanager [64]
 

Detailed Description

A Dispatcher watches a number of devices and signals for activity and dispatches to the proper function when activity is observed.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InputRead 

Inactive handle.

InputWrite 

Read input handle.

InputExcept 

Write input handle.

◆ anonymous enum

anonymous enum
Enumerator
DispatchSignals 

Dispatch all events.

DispatchTimers 

Dispatch signals.

DispatchIdle 

Dispatch timers.

DispatchInputs 

Dispatch idle processing.


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

Copyright © 1997-2018 Jeroen van der Zijp