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

ACE_XtReactor Class Reference

An object-oriented event demultiplexor and event handler dispatcher that uses the X Toolkit functions. More...

#include <XtReactor.h>

Inheritance diagram for ACE_XtReactor:

Inheritance graph
[legend]
Collaboration diagram for ACE_XtReactor:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_XtReactor (XtAppContext context=0, size_t size=DEFAULT_SIZE, int restart=0, ACE_Sig_Handler *=0)
virtual ~ACE_XtReactor (void)
XtAppContext context (void) const
void context (XtAppContext)
virtual long schedule_timer (ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, const ACE_Time_Value &interval)
 Schedule an ACE_Event_Handler that will expire after an amount of time. More...

virtual int reset_timer_interval (long timer_id, const ACE_Time_Value &interval)
 Resets the interval of the timer represented by <timer_id> to <interval>, which is specified in relative time to the current <gettimeofday>. More...

virtual int cancel_timer (ACE_Event_Handler *handler, int dont_call_handle_close=1)
 Cancel all Event_Handlers that match the address of <event_handler>. Returns number of handlers cancelled. More...

virtual int cancel_timer (long timer_id, const void **arg=0, int dont_call_handle_close=1)
 Cancel the single Event_Handler that matches the <timer_id> value (which was returned from the schedule method). More...


Protected Methods

virtual int register_handler_i (ACE_HANDLE handle, ACE_Event_Handler *handler, ACE_Reactor_Mask mask)
 Register a single <handler>. More...

virtual int register_handler_i (const ACE_Handle_Set &handles, ACE_Event_Handler *handler, ACE_Reactor_Mask mask)
 Register a set of <handlers>. More...

virtual int remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask)
 Remove the <handler> associated with this <handle>. More...

virtual int remove_handler_i (const ACE_Handle_Set &handles, ACE_Reactor_Mask)
 Remove a set of <handles>. More...

virtual void remove_XtInput (ACE_HANDLE handle)
 Removes an Xt handle. More...

virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &, ACE_Time_Value *)
 Wait for events to occur. More...

virtual int XtWaitForMultipleEvents (int, ACE_Select_Reactor_Handle_Set &, ACE_Time_Value *)
 Wait for Xt events to occur. More...


Protected Attributes

XtAppContext context_
ACE_XtReactorIDids_
XtIntervalId timeout_

Private Methods

void reset_timeout (void)
 This method ensures there's an Xt timeout for the first timeout in the Reactor's Timer_Queue. More...

 ACE_XtReactor (const ACE_XtReactor &)
 Deny access since member-wise won't work... More...

ACE_XtReactor & operator= (const ACE_XtReactor &)

Static Private Methods

void TimerCallbackProc (XtPointer closure, XtIntervalId *id)
void InputCallbackProc (XtPointer closure, int *source, XtInputId *id)

Detailed Description

An object-oriented event demultiplexor and event handler dispatcher that uses the X Toolkit functions.


Constructor & Destructor Documentation

ACE_XtReactor::ACE_XtReactor XtAppContext    context = 0,
size_t    size = DEFAULT_SIZE,
int    restart = 0,
ACE_Sig_Handler   = 0
 

ACE_XtReactor::~ACE_XtReactor void    [virtual]
 

ACE_XtReactor::ACE_XtReactor const ACE_XtReactor &    [private]
 

Deny access since member-wise won't work...


Member Function Documentation

int ACE_XtReactor::cancel_timer long    timer_id,
const void **    arg = 0,
int    dont_call_handle_close = 1
[virtual]
 

Cancel the single Event_Handler that matches the <timer_id> value (which was returned from the schedule method).

If arg is non-NULL then it will be set to point to the ``magic cookie'' argument passed in when the Event_Handler was registered. This makes it possible to free up the memory and avoid memory leaks. Returns 1 if cancellation succeeded and 0 if the <timer_id> wasn't found.

Reimplemented from ACE_Reactor_Impl.

int ACE_XtReactor::cancel_timer ACE_Event_Handler   handler,
int    dont_call_handle_close = 1
[virtual]
 

Cancel all Event_Handlers that match the address of <event_handler>. Returns number of handlers cancelled.

Reimplemented from ACE_Reactor_Impl.

void ACE_XtReactor::context XtAppContext    context
 

XtAppContext ACE_XtReactor::context void    const
 

void ACE_XtReactor::InputCallbackProc XtPointer    closure,
int *    source,
XtInputId *    id
[static, private]
 

ACE_XtReactor& ACE_XtReactor::operator= const ACE_XtReactor &    [private]
 

int ACE_XtReactor::register_handler_i const ACE_Handle_Set   handles,
ACE_Event_Handler   handler,
ACE_Reactor_Mask    mask
[protected, virtual]
 

Register a set of <handlers>.

Reimplemented from ACE_Select_Reactor_T.

int ACE_XtReactor::register_handler_i ACE_HANDLE    handle,
ACE_Event_Handler   handler,
ACE_Reactor_Mask    mask
[protected, virtual]
 

Register a single <handler>.

Reimplemented from ACE_Select_Reactor_T.

int ACE_XtReactor::remove_handler_i const ACE_Handle_Set   handles,
ACE_Reactor_Mask    mask
[protected, virtual]
 

Remove a set of <handles>.

Reimplemented from ACE_Select_Reactor_T.

int ACE_XtReactor::remove_handler_i ACE_HANDLE    handle,
ACE_Reactor_Mask    mask
[protected, virtual]
 

Remove the <handler> associated with this <handle>.

Reimplemented from ACE_Select_Reactor_T.

void ACE_XtReactor::remove_XtInput ACE_HANDLE    handle [protected, virtual]
 

Removes an Xt handle.

void ACE_XtReactor::reset_timeout void    [private]
 

This method ensures there's an Xt timeout for the first timeout in the Reactor's Timer_Queue.

int ACE_XtReactor::reset_timer_interval long    timer_id,
const ACE_Time_Value   interval
[virtual]
 

Resets the interval of the timer represented by <timer_id> to <interval>, which is specified in relative time to the current <gettimeofday>.

If <interval> is equal to <ACE_Time_Value::zero>, the timer will become a non-rescheduling timer. Returns 0 if successful, -1 if not.

Reimplemented from ACE_Reactor_Impl.

long ACE_XtReactor::schedule_timer ACE_Event_Handler   event_handler,
const void *    arg,
const ACE_Time_Value   delay,
const ACE_Time_Value   interval
[virtual]
 

Schedule an ACE_Event_Handler that will expire after an amount of time.

The return value of this method, a timer_id value, uniquely identifies the event_handler in the ACE_Reactor's internal list of timers. This timer_id value can be used to cancel the timer with the cancel_timer() call.

See also:
cancel_timer() , reset_timer_interval()
Parameters:
event_handler  event handler to schedule on reactor
arg  argument passed to the handle_timeout() method of event_handler
delay  time interval after which the timer will expire
interval  time interval after which the timer will be automatically rescheduled
Returns:
-1 on failure, a timer_id value on success

Reimplemented from ACE_Reactor_Impl.

void ACE_XtReactor::TimerCallbackProc XtPointer    closure,
XtIntervalId *    id
[static, private]
 

int ACE_XtReactor::wait_for_multiple_events ACE_Select_Reactor_Handle_Set   handle_set,
ACE_Time_Value   max_wait_time
[protected, virtual]
 

Wait for events to occur.

Reimplemented from ACE_Select_Reactor_T.

int ACE_XtReactor::XtWaitForMultipleEvents int    width,
ACE_Select_Reactor_Handle_Set   wait_set,
ACE_Time_Value  
[protected, virtual]
 

Wait for Xt events to occur.


Member Data Documentation

XtAppContext ACE_XtReactor::context_ [protected]
 

ACE_XtReactorID* ACE_XtReactor::ids_ [protected]
 

XtIntervalId ACE_XtReactor::timeout_ [protected]
 


The documentation for this class was generated from the following files:
Generated on Sun Dec 1 11:31:08 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001