Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / FoxReactor / FoxReactor.h
blobf837af62f16e8e2bfb15de99b742fe6b2382137f
1 /* -*- C-*- */
3 //=============================================================================
4 /**
5 * @file FoxReactor.h
7 * @author Dmitriy Nikitinskiy <nick@bel.ru>
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_FOXREACTOR_H
17 #define ACE_FOXREACTOR_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/Select_Reactor.h"
27 #include "ace/FoxReactor/ACE_FoxReactor_export.h"
29 #include <fx.h>
31 /**
32 * @class ACE_FoxReactor
34 * @brief A Reactor implementation that uses the FOX toolkit (www.fox-toolkit.org)
35 * for event demultiplexing. This will let us integrate the FOX
36 * toolkit with ACE and/or TAO.
38 class ACE_FoxReactor_Export ACE_FoxReactor : public FXObject, public ACE_Select_Reactor
40 FXDECLARE(ACE_FoxReactor)
41 public:
42 ACE_FoxReactor (FXApp* a=0,
43 size_t size = DEFAULT_SIZE,
44 bool restart = false,
45 ACE_Sig_Handler * = 0);
46 virtual ~ACE_FoxReactor ();
48 void fxapplication(FXApp* a);
50 // = Timer operations.
51 virtual long schedule_timer (ACE_Event_Handler *event_handler,
52 const void *arg,
53 const ACE_Time_Value &delay,
54 const ACE_Time_Value &interval);
55 virtual int reset_timer_interval (long timer_id,
56 const ACE_Time_Value &interval);
57 virtual int cancel_timer (ACE_Event_Handler *handler,
58 int dont_call_handle_close = 1);
59 virtual int cancel_timer (long timer_id,
60 const void **arg = 0,
61 int dont_call_handle_close = 1);
63 // = Integrate with the Fox callback function mechanism.
64 long onFileEvents (FXObject*, FXSelector, void*);
65 long onTimerEvents (FXObject*, FXSelector, void*);
68 protected:
69 // = Register timers/handles with Fox.
70 /// Register a single @a handler.
71 virtual int register_handler_i (ACE_HANDLE handle,
72 ACE_Event_Handler *handler,
73 ACE_Reactor_Mask mask);
75 /// Register a set of <handlers>.
76 virtual int register_handler_i (const ACE_Handle_Set &handles,
77 ACE_Event_Handler *handler,
78 ACE_Reactor_Mask mask);
80 /// Remove the <handler> associated with this @a handle.
81 virtual int remove_handler_i (ACE_HANDLE handle,
82 ACE_Reactor_Mask mask);
84 /// Remove a set of <handles>.
85 virtual int remove_handler_i (const ACE_Handle_Set &handles,
86 ACE_Reactor_Mask);
88 /// Wait for events to occur.
89 virtual int wait_for_multiple_events (ACE_Select_Reactor_Handle_Set &,
90 ACE_Time_Value *);
92 int FoxWaitForMultipleEvents (int,ACE_Select_Reactor_Handle_Set &,ACE_Time_Value *);
94 private:
95 /// This method ensures there's an Fox timeout for the first timeout
96 /// in the Reactor's Timer_Queue.
97 void reset_timeout ();
99 FXApp *fxapp;
101 /// Deny access since member-wise won't work...
102 ACE_FoxReactor (const ACE_FoxReactor &);
103 ACE_FoxReactor &operator = (const ACE_FoxReactor &);
106 #include /**/ "ace/post.h"
107 #endif /* ACE_FOXREACTOR_H */