Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / Reactor.inl
blob809e63d59228149e8e2b31f39a9450d964e3e0f2
1 // -*- C++ -*-
2 #include "ace/Reactor_Impl.h"
4 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
6 // Run the event loop until the <ACE_Reactor::handle_events> method
7 // returns -1 or the <end_event_loop> method is invoked.
8 ACE_INLINE int
9 ACE_Reactor::run_event_loop ()
11   ACE_TRACE ("ACE_Reactor::run_event_loop");
12   ACE_Reactor *r = ACE_Reactor::instance ();
14   if (r == 0)
15     return -1;
17   return r->run_reactor_event_loop (ACE_Reactor::check_reconfiguration);
20 // Run the event loop until the <ACE_Reactor::handle_events>
21 // method returns -1, the <end_event_loop> method
22 // is invoked, or the <ACE_Time_Value> expires.
24 ACE_INLINE int
25 ACE_Reactor::run_event_loop (ACE_Time_Value &tv)
27   ACE_TRACE ("ACE_Reactor::run_event_loop");
28   ACE_Reactor *r = ACE_Reactor::instance ();
30   if (r == 0)
31     return -1;
33   return r->run_reactor_event_loop
34     (tv, ACE_Reactor::check_reconfiguration);
37 // Run the event loop until the <ACE_Reactor::alertable_handle_events> method
38 // returns -1 or the <end_event_loop> method is invoked.
40 ACE_INLINE int
41 ACE_Reactor::run_alertable_event_loop ()
43   ACE_TRACE ("ACE_Reactor::run_alertable_event_loop");
44   ACE_Reactor *r = ACE_Reactor::instance ();
46   if (r == 0)
47     return -1;
49   return r->run_alertable_reactor_event_loop (ACE_Reactor::check_reconfiguration);
52 // Run the event loop until the <ACE_Reactor::alertable_handle_events>
53 // method returns -1, the <end_event_loop> method
54 // is invoked, or the <ACE_Time_Value> expires.
56 ACE_INLINE int
57 ACE_Reactor::run_alertable_event_loop (ACE_Time_Value &tv)
59   ACE_TRACE ("ACE_Reactor::run_alertable_event_loop");
60   ACE_Reactor *r = ACE_Reactor::instance ();
62   if (r == 0)
63     return -1;
65   return r->run_alertable_reactor_event_loop
66     (tv, ACE_Reactor::check_reconfiguration);
69 ACE_INLINE void
70 ACE_Reactor::reset_event_loop ()
72   ACE_TRACE ("ACE_Reactor::reset_event_loop");
74   ACE_Reactor::instance ()->reset_reactor_event_loop ();
77 ACE_INLINE int
78 ACE_Reactor::end_event_loop ()
80   ACE_TRACE ("ACE_Reactor::end_event_loop");
81   ACE_Reactor::instance ()->end_reactor_event_loop ();
83   return 0;
86 ACE_INLINE int
87 ACE_Reactor::event_loop_done ()
89   ACE_TRACE ("ACE_Reactor::event_loop_done");
90   return ACE_Reactor::instance ()->reactor_event_loop_done ();
93 ACE_INLINE int
94 ACE_Reactor::end_reactor_event_loop ()
96   ACE_TRACE ("ACE_Reactor::end_reactor_event_loop");
98   this->implementation_->deactivate (1);
100   return 0;
103 ACE_INLINE void
104 ACE_Reactor::reset_reactor_event_loop ()
106   ACE_TRACE ("ACE_Reactor::reset_reactor_event_loop");
108   this->implementation_->deactivate (0);
111 ACE_INLINE int
112 ACE_Reactor::resumable_handler ()
114   return this->implementation ()->resumable_handler ();
117 ACE_INLINE ACE_Reactor_Impl *
118 ACE_Reactor::implementation () const
120   return this->implementation_;
123 ACE_INLINE void
124 ACE_Reactor::implementation (ACE_Reactor_Impl *impl)
126   this->implementation_ = impl;
129 ACE_INLINE int
130 ACE_Reactor::current_info (ACE_HANDLE handle, size_t &size)
132   return this->implementation ()->current_info (handle, size);
135 ACE_INLINE int
136 ACE_Reactor::open (size_t size,
137                    bool restart,
138                    ACE_Sig_Handler *signal_handler,
139                    ACE_Timer_Queue *timer_queue)
141   return this->implementation ()->open (size,
142                                         restart,
143                                         signal_handler,
144                                         timer_queue);
146 ACE_INLINE int
147 ACE_Reactor::set_sig_handler (ACE_Sig_Handler *signal_handler)
149   return this->implementation ()->set_sig_handler (signal_handler);
152 ACE_INLINE int
153 ACE_Reactor::timer_queue (ACE_Timer_Queue *tq)
155   return this->implementation ()->timer_queue (tq);
158 ACE_INLINE ACE_Timer_Queue *
159 ACE_Reactor::timer_queue () const
161   return this->implementation ()->timer_queue ();
164 ACE_INLINE int
165 ACE_Reactor::close ()
167   return this->implementation ()->close ();
170 ACE_INLINE int
171 ACE_Reactor::work_pending (const ACE_Time_Value &max_wait_time)
173   return this->implementation ()->work_pending (max_wait_time);
176 ACE_INLINE int
177 ACE_Reactor::handle_events (ACE_Time_Value *max_wait_time)
179   return this->implementation ()->handle_events (max_wait_time);
182 ACE_INLINE int
183 ACE_Reactor::alertable_handle_events (ACE_Time_Value *max_wait_time)
185   return this->implementation ()->alertable_handle_events (max_wait_time);
188 ACE_INLINE int
189 ACE_Reactor::handle_events (ACE_Time_Value &max_wait_time)
191   return this->implementation ()->handle_events (max_wait_time);
194 ACE_INLINE int
195 ACE_Reactor::alertable_handle_events (ACE_Time_Value &max_wait_time)
197   return this->implementation ()->alertable_handle_events (max_wait_time);
200 ACE_INLINE int
201 ACE_Reactor::register_handler (int signum,
202                                ACE_Event_Handler *new_sh,
203                                ACE_Sig_Action *new_disp,
204                                ACE_Event_Handler **old_sh,
205                                ACE_Sig_Action *old_disp)
207   return this->implementation ()->register_handler (signum,
208                                                     new_sh,
209                                                     new_disp,
210                                                     old_sh,
211                                                     old_disp);
214 ACE_INLINE int
215 ACE_Reactor::register_handler (const ACE_Sig_Set &sigset,
216                                ACE_Event_Handler *new_sh,
217                                ACE_Sig_Action *new_disp)
219   return this->implementation ()->register_handler (sigset,
220                                                     new_sh,
221                                                     new_disp);
224 ACE_INLINE int
225 ACE_Reactor::remove_handler (ACE_Event_Handler *event_handler,
226                              ACE_Reactor_Mask mask)
228   return this->implementation ()->remove_handler (event_handler, mask);
231 ACE_INLINE int
232 ACE_Reactor::remove_handler (ACE_HANDLE handle,
233                              ACE_Reactor_Mask mask)
235   return this->implementation ()->remove_handler (handle, mask);
238 ACE_INLINE int
239 ACE_Reactor::remove_handler (const ACE_Handle_Set &handle_set,
240                              ACE_Reactor_Mask mask)
242   return this->implementation ()->remove_handler (handle_set, mask);
245 ACE_INLINE int
246 ACE_Reactor::remove_handler (int signum,
247                              ACE_Sig_Action *new_disp,
248                              ACE_Sig_Action *old_disp,
249                              int sigkey)
251   return this->implementation ()->remove_handler (signum,
252                                                   new_disp,
253                                                   old_disp,
254                                                   sigkey);
257 ACE_INLINE int
258 ACE_Reactor::remove_handler (const ACE_Sig_Set &sigset)
260   return this->implementation ()->remove_handler (sigset);
263 ACE_INLINE int
264 ACE_Reactor::suspend_handler (ACE_Event_Handler *event_handler)
266   return this->implementation ()->suspend_handler (event_handler);
269 ACE_INLINE int
270 ACE_Reactor::suspend_handler (ACE_HANDLE handle)
272   return this->implementation ()->suspend_handler (handle);
275 ACE_INLINE int
276 ACE_Reactor::suspend_handler (const ACE_Handle_Set &handles)
278   return this->implementation ()->suspend_handler (handles);
281 ACE_INLINE int
282 ACE_Reactor::suspend_handlers ()
284   return this->implementation ()->suspend_handlers ();
287 ACE_INLINE int
288 ACE_Reactor::resume_handler (ACE_Event_Handler *event_handler)
290   return this->implementation ()->resume_handler (event_handler);
293 ACE_INLINE int
294 ACE_Reactor::resume_handler (ACE_HANDLE handle)
296   return this->implementation ()->resume_handler (handle);
299 ACE_INLINE int
300 ACE_Reactor::resume_handler (const ACE_Handle_Set &handles)
302   return this->implementation ()->resume_handler (handles);
305 ACE_INLINE int
306 ACE_Reactor::resume_handlers ()
308   return this->implementation ()->resume_handlers ();
311 ACE_INLINE int
312 ACE_Reactor::schedule_wakeup (ACE_HANDLE handle,
313                               ACE_Reactor_Mask masks_to_be_added)
315   return implementation ()->schedule_wakeup (handle, masks_to_be_added);
318 ACE_INLINE int
319 ACE_Reactor::cancel_wakeup (ACE_Event_Handler *event_handler,
320                             ACE_Reactor_Mask masks_to_be_cleared)
322   return this->implementation ()->cancel_wakeup (event_handler,
323                                                  masks_to_be_cleared);
326 ACE_INLINE int
327 ACE_Reactor::cancel_wakeup (ACE_HANDLE handle,
328                             ACE_Reactor_Mask masks_to_be_cleared)
330   return this->implementation ()->cancel_wakeup (handle,
331                                                  masks_to_be_cleared);
334 ACE_INLINE void
335 ACE_Reactor::max_notify_iterations (int iterations)
337   this->implementation ()->max_notify_iterations (iterations);
340 ACE_INLINE int
341 ACE_Reactor::max_notify_iterations ()
343   return this->implementation ()->max_notify_iterations ();
346 ACE_INLINE int
347 ACE_Reactor::purge_pending_notifications (ACE_Event_Handler *eh,
348                                           ACE_Reactor_Mask   mask)
350   return this->implementation ()->purge_pending_notifications (eh, mask);
353 ACE_INLINE ACE_Event_Handler *
354 ACE_Reactor::find_handler (ACE_HANDLE handle)
356   return this->implementation ()->find_handler (handle);
359 ACE_INLINE int
360 ACE_Reactor::handler (ACE_HANDLE handle,
361                       ACE_Reactor_Mask mask,
362                       ACE_Event_Handler **event_handler)
364   return this->implementation ()->handler (handle, mask, event_handler);
367 ACE_INLINE int
368 ACE_Reactor::handler (int signum,
369                       ACE_Event_Handler **event_handler)
371   return this->implementation ()->handler (signum, event_handler);
374 ACE_INLINE int
375 ACE_Reactor::initialized ()
377   return this->implementation ()->initialized ();
380 ACE_INLINE ACE_Lock &
381 ACE_Reactor::lock ()
383   return this->implementation ()->lock ();
386 ACE_INLINE void
387 ACE_Reactor::wakeup_all_threads ()
389   this->implementation ()->wakeup_all_threads ();
392 ACE_INLINE int
393 ACE_Reactor::owner (ACE_thread_t new_owner, ACE_thread_t *old_owner)
395   return this->implementation ()->owner (new_owner,  old_owner);
398 ACE_INLINE int
399 ACE_Reactor::owner (ACE_thread_t *owner)
401   return this->implementation ()->owner (owner);
404 ACE_INLINE bool
405 ACE_Reactor::restart ()
407   return this->implementation ()->restart ();
410 ACE_INLINE bool
411 ACE_Reactor::restart (bool r)
413   return this->implementation ()->restart (r);
416 ACE_INLINE void
417 ACE_Reactor::requeue_position (int position)
419   this->implementation ()->requeue_position (position);
422 ACE_INLINE int
423 ACE_Reactor::requeue_position ()
425   return this->implementation ()->requeue_position ();
428 ACE_INLINE int
429 ACE_Reactor::mask_ops (ACE_Event_Handler *event_handler,
430                        ACE_Reactor_Mask mask,
431                        int ops)
433   return this->implementation ()->mask_ops (event_handler, mask, ops);
436 ACE_INLINE int
437 ACE_Reactor::mask_ops (ACE_HANDLE handle,
438                        ACE_Reactor_Mask mask,
439                        int ops)
441   return this->implementation ()->mask_ops (handle, mask, ops);
444 ACE_INLINE int
445 ACE_Reactor::ready_ops (ACE_Event_Handler *event_handler,
446                         ACE_Reactor_Mask mask,
447                         int ops)
449   return this->implementation ()->ready_ops (event_handler, mask, ops);
452 ACE_INLINE int
453 ACE_Reactor::ready_ops (ACE_HANDLE handle,
454                         ACE_Reactor_Mask mask,
455                         int ops)
457   return this->implementation ()->ready_ops (handle, mask, ops);
460 ACE_INLINE int
461 ACE_Reactor::reactor_event_loop_done ()
463   ACE_TRACE ("ACE_Reactor::reactor_event_loop_done");
464   return this->implementation_->deactivated ();
467 ACE_INLINE size_t
468 ACE_Reactor::size () const
470   return this->implementation ()->size ();
473 ACE_INLINE bool
474 ACE_Reactor::uses_event_associations ()
476   return this->implementation ()->uses_event_associations ();
479 ACE_INLINE void
480 ACE_Reactor::dump () const
482 #if defined (ACE_HAS_DUMP)
483   ACE_TRACE ("ACE_Reactor::dump");
485   implementation_->dump ();
486 #endif /* ACE_HAS_DUMP */
489 ACE_END_VERSIONED_NAMESPACE_DECL