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

FlReactor.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   FlReactor.h
00006  *
00007  *  $Id: FlReactor.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Carlos O'Ryan <coryan@cs.wustl.edu>
00010  *  @author Based in part in the ACE_XtReactor implementation by
00011  *  @author Eric C. Newton's <ecn@clark.net>
00012  *  @author Kirill Rybaltchenko <Kirill.Rybaltchenko@cern.ch>
00013  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
00014  */
00015 //=============================================================================
00016 
00017 
00018 #ifndef ACE_FLREACTOR_H
00019 #define ACE_FLREACTOR_H
00020 #include "ace/pre.h"
00021 
00022 #include "ace/config-all.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #if defined (ACE_HAS_FL)
00029 
00030 #include "ace/Select_Reactor.h"
00031 
00032 /**
00033  * @class ACE_FlReactor
00034  *
00035  * @brief A Reactor implementation that uses the Fast-Light (FL) toolkit
00036  * for event demultiplexing.  This will let us integrate the FL
00037  * toolkit with ACE and/or TAO.
00038  *
00039  * As many other GUI toolkits FL supports a minimal set of
00040  * callbacks to handle event demultiplexing, namely simple methods
00041  * to add file descriptors to the event demuxing set or timeout
00042  * events.  This class adapts this simple mechanisms so they are
00043  * compatible with ACE's Reactor.
00044  */
00045 class ACE_Export ACE_FlReactor : public ACE_Select_Reactor
00046 {
00047 
00048 public:
00049   // = Initialization and termination methods.
00050   ACE_FlReactor (size_t size = DEFAULT_SIZE,
00051                  int restart = 0,
00052                  ACE_Sig_Handler * = 0);
00053   virtual ~ACE_FlReactor (void);
00054 
00055   // = Timer operations.
00056   virtual long schedule_timer (ACE_Event_Handler *event_handler,
00057                                const void *arg,
00058                                const ACE_Time_Value &delay,
00059                                const ACE_Time_Value &interval);
00060   virtual int reset_timer_interval (long timer_id,
00061                                     const ACE_Time_Value &interval);
00062   virtual int cancel_timer (ACE_Event_Handler *handler,
00063                             int dont_call_handle_close = 1);
00064   virtual int cancel_timer (long timer_id,
00065                             const void **arg = 0,
00066                             int dont_call_handle_close = 1);
00067 
00068 protected:
00069   // = Register timers/handles with Fl.
00070   /// Register a single <handler>.
00071   virtual int register_handler_i (ACE_HANDLE handle,
00072                                   ACE_Event_Handler *handler,
00073                                   ACE_Reactor_Mask mask);
00074 
00075   /// Register a set of <handlers>.
00076   virtual int register_handler_i (const ACE_Handle_Set &handles,
00077                                   ACE_Event_Handler *handler,
00078                                   ACE_Reactor_Mask mask);
00079 
00080   /// Remove the <handler> associated with this <handle>.
00081   virtual int remove_handler_i (ACE_HANDLE handle,
00082                                 ACE_Reactor_Mask mask);
00083 
00084   /// Remove a set of <handles>.
00085   virtual int remove_handler_i (const ACE_Handle_Set &handles,
00086                                 ACE_Reactor_Mask);
00087 
00088   /// Wait for events to occur.
00089   virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
00090                                         ACE_Time_Value *);
00091 
00092 private:
00093   /// This method ensures there's an Fl timeout for the first timeout
00094   /// in the Reactor's Timer_Queue.
00095   void reset_timeout (void);
00096 
00097   // = Integrate with the FL callback function mechanism.
00098   static void fl_io_proc (int fd, void*);
00099   static void fl_timeout_proc (void*);
00100 
00101   /// Deny access since member-wise won't work...
00102   ACE_FlReactor (const ACE_FlReactor &);
00103   ACE_FlReactor &operator = (const ACE_FlReactor &);
00104 };
00105 
00106 #if defined(__ACE_INLINE__)
00107 #include "ace/FlReactor.i"
00108 #endif /* __ACE_INLINE__ */
00109 
00110 #endif /* ACE_HAS_FL */
00111 
00112 #include "ace/post.h"
00113 #endif /* ACE_FLREACTOR_H */

Generated on Mon Jun 16 11:19:43 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002