Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / FlReactor / FlReactor.h
blobb2d3283fcb68af709eb2fd78666d76cf6bb2d8d9
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file FlReactor.h
7 * @author Carlos O'Ryan <coryan@cs.wustl.edu>
8 * @author Based in part in the ACE_XtReactor implementation by
9 * @author Eric C. Newton's <ecn@clark.net>
10 * @author Kirill Rybaltchenko <Kirill.Rybaltchenko@cern.ch>
11 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
13 //=============================================================================
16 #ifndef ACE_FLREACTOR_H
17 #define ACE_FLREACTOR_H
18 #include /**/ "ace/pre.h"
20 #include /**/ "ace/config-all.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/FlReactor/ACE_FlReactor_export.h"
27 #include "ace/Select_Reactor.h"
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 /**
32 * @class ACE_FlReactor
34 * @brief A Reactor implementation that uses the Fast-Light (FL) toolkit
35 * for event demultiplexing. This will let us integrate the FL
36 * toolkit with ACE and/or TAO.
38 * As many other GUI toolkits FL supports a minimal set of
39 * callbacks to handle event demultiplexing, namely simple methods
40 * to add file descriptors to the event demuxing set or timeout
41 * events. This class adapts this simple mechanisms so they are
42 * compatible with ACE's Reactor.
44 class ACE_FlReactor_Export ACE_FlReactor : public ACE_Select_Reactor
46 public:
47 ACE_FlReactor (size_t size = DEFAULT_SIZE,
48 bool restart = false,
49 ACE_Sig_Handler * = 0);
50 virtual ~ACE_FlReactor ();
52 // = Timer operations.
53 virtual long schedule_timer (ACE_Event_Handler *event_handler,
54 const void *arg,
55 const ACE_Time_Value &delay,
56 const ACE_Time_Value &interval);
57 virtual int reset_timer_interval (long timer_id,
58 const ACE_Time_Value &interval);
59 virtual int cancel_timer (ACE_Event_Handler *handler,
60 int dont_call_handle_close = 1);
61 virtual int cancel_timer (long timer_id,
62 const void **arg = 0,
63 int dont_call_handle_close = 1);
65 protected:
66 // = Register timers/handles with Fl.
67 /// Register a single @a handler.
68 virtual int register_handler_i (ACE_HANDLE handle,
69 ACE_Event_Handler *handler,
70 ACE_Reactor_Mask mask);
72 /// Register a set of <handlers>.
73 virtual int register_handler_i (const ACE_Handle_Set &handles,
74 ACE_Event_Handler *handler,
75 ACE_Reactor_Mask mask);
77 /// Remove the <handler> associated with this @a handle.
78 virtual int remove_handler_i (ACE_HANDLE handle,
79 ACE_Reactor_Mask mask);
81 /// Remove a set of <handles>.
82 virtual int remove_handler_i (const ACE_Handle_Set &handles,
83 ACE_Reactor_Mask);
85 /// Wait for events to occur.
86 virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
87 ACE_Time_Value *);
89 private:
90 /// This method ensures there's an Fl timeout for the first timeout
91 /// in the Reactor's Timer_Queue.
92 void reset_timeout ();
94 // = Integrate with the FL callback function mechanism.
95 static void fl_io_proc (int fd, void*);
96 static void fl_timeout_proc (void*);
98 /// Deny access since member-wise won't work...
99 ACE_FlReactor (const ACE_FlReactor &);
100 ACE_FlReactor &operator = (const ACE_FlReactor &);
103 ACE_END_VERSIONED_NAMESPACE_DECL
105 #include /**/ "ace/post.h"
106 #endif /* ACE_FLREACTOR_H */