GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / Reactor.inl
blob5d2bc60cfffda9e904cb77b5aae0b20003dcd3db
1 // -*- C++ -*-
2 #include "ace/Reactor_Impl.h"
4 /*
5  * Hook to specialize the Reactor with the concrete implementation
6  * known at compile time.
7  */
8 //@@ REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 // Run the event loop until the <ACE_Reactor::handle_events> method
13 // returns -1 or the <end_event_loop> method is invoked.
14 ACE_INLINE int
15 ACE_Reactor::run_event_loop (void)
17   ACE_TRACE ("ACE_Reactor::run_event_loop");
18   ACE_Reactor *r = ACE_Reactor::instance ();
20   if (r == 0)
21     return -1;
23   return r->run_reactor_event_loop (ACE_Reactor::check_reconfiguration);
26 // Run the event loop until the <ACE_Reactor::handle_events>
27 // method returns -1, the <end_event_loop> method
28 // is invoked, or the <ACE_Time_Value> expires.
30 ACE_INLINE int
31 ACE_Reactor::run_event_loop (ACE_Time_Value &tv)
33   ACE_TRACE ("ACE_Reactor::run_event_loop");
34   ACE_Reactor *r = ACE_Reactor::instance ();
36   if (r == 0)
37     return -1;
39   return r->run_reactor_event_loop
40     (tv, ACE_Reactor::check_reconfiguration);
43 // Run the event loop until the <ACE_Reactor::alertable_handle_events> method
44 // returns -1 or the <end_event_loop> method is invoked.
46 ACE_INLINE int
47 ACE_Reactor::run_alertable_event_loop (void)
49   ACE_TRACE ("ACE_Reactor::run_alertable_event_loop");
50   ACE_Reactor *r = ACE_Reactor::instance ();
52   if (r == 0)
53     return -1;
55   return r->run_alertable_reactor_event_loop (ACE_Reactor::check_reconfiguration);
58 // Run the event loop until the <ACE_Reactor::alertable_handle_events>
59 // method returns -1, the <end_event_loop> method
60 // is invoked, or the <ACE_Time_Value> expires.
62 ACE_INLINE int
63 ACE_Reactor::run_alertable_event_loop (ACE_Time_Value &tv)
65   ACE_TRACE ("ACE_Reactor::run_alertable_event_loop");
66   ACE_Reactor *r = ACE_Reactor::instance ();
68   if (r == 0)
69     return -1;
71   return r->run_alertable_reactor_event_loop
72     (tv, ACE_Reactor::check_reconfiguration);
75 ACE_INLINE void
76 ACE_Reactor::reset_event_loop (void)
78   ACE_TRACE ("ACE_Reactor::reset_event_loop");
80   ACE_Reactor::instance ()->reset_reactor_event_loop ();
83 ACE_INLINE int
84 ACE_Reactor::end_event_loop (void)
86   ACE_TRACE ("ACE_Reactor::end_event_loop");
87   ACE_Reactor::instance ()->end_reactor_event_loop ();
89   return 0;
92 ACE_INLINE int
93 ACE_Reactor::event_loop_done (void)
95   ACE_TRACE ("ACE_Reactor::event_loop_done");
96   return ACE_Reactor::instance ()->reactor_event_loop_done ();
99 ACE_INLINE int
100 ACE_Reactor::end_reactor_event_loop (void)
102   ACE_TRACE ("ACE_Reactor::end_reactor_event_loop");
104   this->implementation_->deactivate (1);
106   return 0;
109 ACE_INLINE void
110 ACE_Reactor::reset_reactor_event_loop (void)
112   ACE_TRACE ("ACE_Reactor::reset_reactor_event_loop");
114   this->implementation_->deactivate (0);
117 ACE_INLINE int
118 ACE_Reactor::resumable_handler (void)
120   return this->implementation ()->resumable_handler ();
123 ACE_INLINE ACE_Reactor_Impl *
124 ACE_Reactor::implementation (void) const
126   return this->implementation_;
129 ACE_INLINE void
130 ACE_Reactor::implementation (ACE_Reactor_Impl *impl)
132   this->implementation_ = impl;
135 ACE_INLINE int
136 ACE_Reactor::current_info (ACE_HANDLE handle, size_t &size)
138   return this->implementation ()->current_info (handle, size);
141 ACE_INLINE int
142 ACE_Reactor::open (size_t size,
143                    bool restart,
144                    ACE_Sig_Handler *signal_handler,
145                    ACE_Timer_Queue *timer_queue)
147   return this->implementation ()->open (size,
148                                         restart,
149                                         signal_handler,
150                                         timer_queue);
152 ACE_INLINE int
153 ACE_Reactor::set_sig_handler (ACE_Sig_Handler *signal_handler)
155   return this->implementation ()->set_sig_handler (signal_handler);
158 ACE_INLINE int
159 ACE_Reactor::timer_queue (ACE_Timer_Queue *tq)
161   return this->implementation ()->timer_queue (tq);
164 ACE_INLINE ACE_Timer_Queue *
165 ACE_Reactor::timer_queue (void) const
167   return this->implementation ()->timer_queue ();
170 ACE_INLINE int
171 ACE_Reactor::close (void)
173   return this->implementation ()->close ();
176 ACE_INLINE int
177 ACE_Reactor::work_pending (const ACE_Time_Value &max_wait_time)
179   return this->implementation ()->work_pending (max_wait_time);
182 ACE_INLINE int
183 ACE_Reactor::handle_events (ACE_Time_Value *max_wait_time)
185   return this->implementation ()->handle_events (max_wait_time);
188 ACE_INLINE int
189 ACE_Reactor::alertable_handle_events (ACE_Time_Value *max_wait_time)
191   return this->implementation ()->alertable_handle_events (max_wait_time);
194 ACE_INLINE int
195 ACE_Reactor::handle_events (ACE_Time_Value &max_wait_time)
197   return this->implementation ()->handle_events (max_wait_time);
200 ACE_INLINE int
201 ACE_Reactor::alertable_handle_events (ACE_Time_Value &max_wait_time)
203   return this->implementation ()->alertable_handle_events (max_wait_time);
206 ACE_INLINE int
207 ACE_Reactor::register_handler (int signum,
208                                ACE_Event_Handler *new_sh,
209                                ACE_Sig_Action *new_disp,
210                                ACE_Event_Handler **old_sh,
211                                ACE_Sig_Action *old_disp)
213   return this->implementation ()->register_handler (signum,
214                                                     new_sh,
215                                                     new_disp,
216                                                     old_sh,
217                                                     old_disp);
220 ACE_INLINE int
221 ACE_Reactor::register_handler (const ACE_Sig_Set &sigset,
222                                ACE_Event_Handler *new_sh,
223                                ACE_Sig_Action *new_disp)
225   return this->implementation ()->register_handler (sigset,
226                                                     new_sh,
227                                                     new_disp);
230 ACE_INLINE int
231 ACE_Reactor::remove_handler (ACE_Event_Handler *event_handler,
232                              ACE_Reactor_Mask mask)
234   return this->implementation ()->remove_handler (event_handler, mask);
237 ACE_INLINE int
238 ACE_Reactor::remove_handler (ACE_HANDLE handle,
239                              ACE_Reactor_Mask mask)
241   return this->implementation ()->remove_handler (handle, mask);
244 ACE_INLINE int
245 ACE_Reactor::remove_handler (const ACE_Handle_Set &handle_set,
246                              ACE_Reactor_Mask mask)
248   return this->implementation ()->remove_handler (handle_set, mask);
251 ACE_INLINE int
252 ACE_Reactor::remove_handler (int signum,
253                              ACE_Sig_Action *new_disp,
254                              ACE_Sig_Action *old_disp,
255                              int sigkey)
257   return this->implementation ()->remove_handler (signum,
258                                                   new_disp,
259                                                   old_disp,
260                                                   sigkey);
263 ACE_INLINE int
264 ACE_Reactor::remove_handler (const ACE_Sig_Set &sigset)
266   return this->implementation ()->remove_handler (sigset);
269 ACE_INLINE int
270 ACE_Reactor::suspend_handler (ACE_Event_Handler *event_handler)
272   return this->implementation ()->suspend_handler (event_handler);
275 ACE_INLINE int
276 ACE_Reactor::suspend_handler (ACE_HANDLE handle)
278   return this->implementation ()->suspend_handler (handle);
281 ACE_INLINE int
282 ACE_Reactor::suspend_handler (const ACE_Handle_Set &handles)
284   return this->implementation ()->suspend_handler (handles);
287 ACE_INLINE int
288 ACE_Reactor::suspend_handlers (void)
290   return this->implementation ()->suspend_handlers ();
293 ACE_INLINE int
294 ACE_Reactor::resume_handler (ACE_Event_Handler *event_handler)
296   return this->implementation ()->resume_handler (event_handler);
299 ACE_INLINE int
300 ACE_Reactor::resume_handler (ACE_HANDLE handle)
302   return this->implementation ()->resume_handler (handle);
305 ACE_INLINE int
306 ACE_Reactor::resume_handler (const ACE_Handle_Set &handles)
308   return this->implementation ()->resume_handler (handles);
311 ACE_INLINE int
312 ACE_Reactor::resume_handlers (void)
314   return this->implementation ()->resume_handlers ();
317 ACE_INLINE int
318 ACE_Reactor::schedule_wakeup (ACE_HANDLE handle,
319                               ACE_Reactor_Mask masks_to_be_added)
321   return implementation ()->schedule_wakeup (handle, masks_to_be_added);
324 ACE_INLINE int
325 ACE_Reactor::cancel_wakeup (ACE_Event_Handler *event_handler,
326                             ACE_Reactor_Mask masks_to_be_cleared)
328   return this->implementation ()->cancel_wakeup (event_handler,
329                                                  masks_to_be_cleared);
332 ACE_INLINE int
333 ACE_Reactor::cancel_wakeup (ACE_HANDLE handle,
334                             ACE_Reactor_Mask masks_to_be_cleared)
336   return this->implementation ()->cancel_wakeup (handle,
337                                                  masks_to_be_cleared);
340 ACE_INLINE void
341 ACE_Reactor::max_notify_iterations (int iterations)
343   this->implementation ()->max_notify_iterations (iterations);
346 ACE_INLINE int
347 ACE_Reactor::max_notify_iterations (void)
349   return this->implementation ()->max_notify_iterations ();
352 ACE_INLINE int
353 ACE_Reactor::purge_pending_notifications (ACE_Event_Handler *eh,
354                                           ACE_Reactor_Mask   mask)
356   return this->implementation ()->purge_pending_notifications (eh, mask);
359 ACE_INLINE ACE_Event_Handler *
360 ACE_Reactor::find_handler (ACE_HANDLE handle)
362   return this->implementation ()->find_handler (handle);
365 ACE_INLINE int
366 ACE_Reactor::handler (ACE_HANDLE handle,
367                       ACE_Reactor_Mask mask,
368                       ACE_Event_Handler **event_handler)
370   return this->implementation ()->handler (handle, mask, event_handler);
373 ACE_INLINE int
374 ACE_Reactor::handler (int signum,
375                       ACE_Event_Handler **event_handler)
377   return this->implementation ()->handler (signum, event_handler);
380 ACE_INLINE int
381 ACE_Reactor::initialized (void)
383   return this->implementation ()->initialized ();
386 ACE_INLINE ACE_Lock &
387 ACE_Reactor::lock (void)
389   return this->implementation ()->lock ();
392 ACE_INLINE void
393 ACE_Reactor::wakeup_all_threads (void)
395   this->implementation ()->wakeup_all_threads ();
398 ACE_INLINE int
399 ACE_Reactor::owner (ACE_thread_t new_owner, ACE_thread_t *old_owner)
401   return this->implementation ()->owner (new_owner,  old_owner);
404 ACE_INLINE int
405 ACE_Reactor::owner (ACE_thread_t *owner)
407   return this->implementation ()->owner (owner);
410 ACE_INLINE bool
411 ACE_Reactor::restart (void)
413   return this->implementation ()->restart ();
416 ACE_INLINE bool
417 ACE_Reactor::restart (bool r)
419   return this->implementation ()->restart (r);
422 ACE_INLINE void
423 ACE_Reactor::requeue_position (int position)
425   this->implementation ()->requeue_position (position);
428 ACE_INLINE int
429 ACE_Reactor::requeue_position (void)
431   return this->implementation ()->requeue_position ();
434 ACE_INLINE int
435 ACE_Reactor::mask_ops (ACE_Event_Handler *event_handler,
436                        ACE_Reactor_Mask mask,
437                        int ops)
439   return this->implementation ()->mask_ops (event_handler, mask, ops);
442 ACE_INLINE int
443 ACE_Reactor::mask_ops (ACE_HANDLE handle,
444                        ACE_Reactor_Mask mask,
445                        int ops)
447   return this->implementation ()->mask_ops (handle, mask, ops);
450 ACE_INLINE int
451 ACE_Reactor::ready_ops (ACE_Event_Handler *event_handler,
452                         ACE_Reactor_Mask mask,
453                         int ops)
455   return this->implementation ()->ready_ops (event_handler, mask, ops);
458 ACE_INLINE int
459 ACE_Reactor::ready_ops (ACE_HANDLE handle,
460                         ACE_Reactor_Mask mask,
461                         int ops)
463   return this->implementation ()->ready_ops (handle, mask, ops);
466 ACE_INLINE int
467 ACE_Reactor::reactor_event_loop_done (void)
469   ACE_TRACE ("ACE_Reactor::reactor_event_loop_done");
470   return this->implementation_->deactivated ();
473 ACE_INLINE size_t
474 ACE_Reactor::size (void) const
476   return this->implementation ()->size ();
479 ACE_INLINE bool
480 ACE_Reactor::uses_event_associations (void)
482   return this->implementation ()->uses_event_associations ();
485 ACE_INLINE void
486 ACE_Reactor::dump (void) const
488 #if defined (ACE_HAS_DUMP)
489   ACE_TRACE ("ACE_Reactor::dump");
491   implementation_->dump ();
492 #endif /* ACE_HAS_DUMP */
495 ACE_END_VERSIONED_NAMESPACE_DECL