1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
.TH ACE_WFMO_Reactor_Notify 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_WFMO_Reactor_Notify \- Unblock the from its event loop, passing it an optional to dispatch.
.SH SYNOPSIS
.br
.PP
\fC#include <WFMO_Reactor.h>\fR
.PP
Inherits \fBACE_Reactor_Notify\fR.
.PP
.SS Public Methods
.in +1c
.ti -1c
.RI "\fBACE_WFMO_Reactor_Notify\fR (void)"
.br
.RI "\fIConstructor.\fR"
.ti -1c
.RI "virtual int \fBopen\fR (\fBACE_Reactor_Impl\fR *wfmo_reactor, \fBACE_Timer_Queue\fR *timer_queue, int disable_notify = 0)"
.br
.RI "\fIInitialization. <timer_queue> is stored to call <gettimeofday>.\fR"
.ti -1c
.RI "virtual int \fBclose\fR (void)"
.br
.RI "\fINo-op.\fR"
.ti -1c
.RI "\fBssize_t\fR \fBnotify\fR (\fBACE_Event_Handler\fR *event_handler = 0, \fBACE_Reactor_Mask\fR mask = ACE_Event_Handler::EXCEPT_MASK, \fBACE_Time_Value\fR *timeout = 0)"
.br
.ti -1c
.RI "virtual int \fBdispatch_notifications\fR (int &number_of_active_handles, \fBACE_Handle_Set\fR &rd_mask)"
.br
.RI "\fINo-op.\fR"
.ti -1c
.RI "virtual ACE_HANDLE \fBget_handle\fR (void) const"
.br
.RI "\fIReturns a handle to the .\fR"
.ti -1c
.RI "virtual ACE_HANDLE \fBnotify_handle\fR (void)"
.br
.RI "\fIReturns the ACE_HANDLE of the notify pipe on which the reactor is listening for notifications so that other threads can unblock the <Reactor_Impl>.\fR"
.ti -1c
.RI "virtual int \fBdispatch_notify\fR (\fBACE_Notification_Buffer\fR &buffer)"
.br
.RI "\fIHandle one of the notify call on the <handle>. This could be because of a thread trying to unblock the <Reactor_Impl>.\fR"
.ti -1c
.RI "virtual int \fBis_dispatchable\fR (\fBACE_Notification_Buffer\fR &buffer)"
.br
.RI "\fIVerify whether the buffer has dispatchable info or not.\fR"
.ti -1c
.RI "virtual int \fBread_notify_pipe\fR (ACE_HANDLE handle, \fBACE_Notification_Buffer\fR &buffer)"
.br
.RI "\fIRead one of the notify call on the <handle> into the <buffer>. This could be because of a thread trying to unblock the <Reactor_Impl>.\fR"
.ti -1c
.RI "void \fBmax_notify_iterations\fR (int)"
.br
.ti -1c
.RI "int \fBmax_notify_iterations\fR (void)"
.br
.ti -1c
.RI "virtual int \fBpurge_pending_notifications\fR (\fBACE_Event_Handler\fR *, \fBACE_Reactor_Mask\fR = ACE_Event_Handler::ALL_EVENTS_MASK)"
.br
.ti -1c
.RI "virtual void \fBdump\fR (void) const"
.br
.RI "\fIDump the state of an object.\fR"
.in -1c
.SS Private Methods
.in +1c
.ti -1c
.RI "virtual int \fBhandle_signal\fR (int signum, \fBsiginfo_t\fR * = 0, \fBucontext_t\fR * = 0)"
.br
.in -1c
.SS Private Attributes
.in +1c
.ti -1c
.RI "\fBACE_Timer_Queue\fR* \fBtimer_queue_\fR"
.br
.RI "\fIPointer to the wfmo_reactor's timer queue.\fR"
.ti -1c
.RI "\fBACE_Auto_Event\fR \fBwakeup_one_thread_\fR"
.br
.RI "\fIAn auto event is used so that we can <signal> it to wakeup one thread up (e.g., when the <notify> method is called).\fR"
.ti -1c
.RI "\fBACE_Message_Queue\fR<ACE_MT_SYNCH> \fBmessage_queue_\fR"
.br
.ti -1c
.RI "int \fBmax_notify_iterations_\fR"
.br
.in -1c
.SH DETAILED DESCRIPTION
.PP
Unblock the from its event loop, passing it an optional to dispatch.
.PP
.PP
This implementation is necessary for cases where the is run in a multi-threaded program. In this case, we need to be able to unblock <WaitForMultipleObjects> when updates occur other than in the main thread. To do this, we signal an auto-reset event the is listening on. If an and is passed to <notify>, the appropriate <handle_*> method is dispatched.
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP
.SS ACE_WFMO_Reactor_Notify::ACE_WFMO_Reactor_Notify (void)
.PP
Constructor.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP
.SS int ACE_WFMO_Reactor_Notify::close (void)\fC [virtual]\fR
.PP
No-op.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::dispatch_notifications (int & number_of_active_handles, \fBACE_Handle_Set\fR & rd_mask)\fC [virtual]\fR
.PP
No-op.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::dispatch_notify (\fBACE_Notification_Buffer\fR & buffer)\fC [virtual]\fR
.PP
Handle one of the notify call on the <handle>. This could be because of a thread trying to unblock the <Reactor_Impl>.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS void ACE_WFMO_Reactor_Notify::dump (void) const\fC [virtual]\fR
.PP
Dump the state of an object.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS ACE_HANDLE ACE_WFMO_Reactor_Notify::get_handle (void) const\fC [virtual]\fR
.PP
Returns a handle to the .
.PP
Reimplemented from \fBACE_Event_Handler\fR.
.SS int ACE_WFMO_Reactor_Notify::handle_signal (int signum, \fBsiginfo_t\fR * = 0, \fBucontext_t\fR * = 0)\fC [private, virtual]\fR
.PP
Called when the notification event waited on by is signaled. This dequeues all pending and dispatches them.
.PP
Reimplemented from \fBACE_Event_Handler\fR.
.SS int ACE_WFMO_Reactor_Notify::is_dispatchable (\fBACE_Notification_Buffer\fR & buffer)\fC [virtual]\fR
.PP
Verify whether the buffer has dispatchable info or not.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::max_notify_iterations (void)\fC [virtual]\fR
.PP
Get the maximum number of times that the method will iterate and dispatch the that are passed in via the notify queue before breaking out of its loop.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS void ACE_WFMO_Reactor_Notify::max_notify_iterations (int)\fC [virtual]\fR
.PP
Set the maximum number of times that the method will iterate and dispatch the that are passed in via the notify queue before breaking out of its loop. By default, this is set to -1, which means "iterate until the queue is empty." Setting this to a value like "1 or 2" will increase "fairness" (and thus prevent starvation) at the expense of slightly higher dispatching overhead.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS \fBssize_t\fR ACE_WFMO_Reactor_Notify::notify (\fBACE_Event_Handler\fR * event_handler = 0, \fBACE_Reactor_Mask\fR mask = ACE_Event_Handler::EXCEPT_MASK, \fBACE_Time_Value\fR * timeout = 0)\fC [virtual]\fR
.PP
Special trick to unblock <WaitForMultipleObjects> when updates occur. All we do is enqueue <event_handler> and <mask> onto the and wakeup the <WFMO_Reactor> by signaling its handle. The indicates how long to blocking trying to notify the <WFMO_Reactor>. If <timeout> == 0, the caller will block until action is possible, else will wait until the relative time specified in <timeout> elapses).
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS ACE_HANDLE ACE_WFMO_Reactor_Notify::notify_handle (void)\fC [virtual]\fR
.PP
Returns the ACE_HANDLE of the notify pipe on which the reactor is listening for notifications so that other threads can unblock the <Reactor_Impl>.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::open (\fBACE_Reactor_Impl\fR * wfmo_reactor, \fBACE_Timer_Queue\fR * timer_queue, int disable_notify = 0)\fC [virtual]\fR
.PP
Initialization. <timer_queue> is stored to call <gettimeofday>.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::purge_pending_notifications (\fBACE_Event_Handler\fR *, \fBACE_Reactor_Mask\fR = ACE_Event_Handler::ALL_EVENTS_MASK)\fC [virtual]\fR
.PP
Purge any notifications pending in this reactor for the specified object. If <eh> == 0, all notifications for all handlers are removed (but not any notifications posted just to wake up the reactor itself). Returns the number of notifications purged. Returns -1 on error.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SS int ACE_WFMO_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, \fBACE_Notification_Buffer\fR & buffer)\fC [virtual]\fR
.PP
Read one of the notify call on the <handle> into the <buffer>. This could be because of a thread trying to unblock the <Reactor_Impl>.
.PP
Reimplemented from \fBACE_Reactor_Notify\fR.
.SH MEMBER DATA DOCUMENTATION
.PP
.SS int ACE_WFMO_Reactor_Notify::max_notify_iterations_\fC [private]\fR
.PP
Keeps track of the maximum number of times that the method will iterate and dispatch the that are passed in via the notify queue before breaking out of its loop. By default, this is set to -1, which means "iterate until the queue is empty."
.SS \fBACE_Message_Queue\fR< ACE_MT_SYNCH > ACE_WFMO_Reactor_Notify::message_queue_\fC [private]\fR
.PP
.SS \fBACE_Timer_Queue\fR * ACE_WFMO_Reactor_Notify::timer_queue_\fC [private]\fR
.PP
Pointer to the wfmo_reactor's timer queue.
.PP
.SS \fBACE_Auto_Event\fR ACE_WFMO_Reactor_Notify::wakeup_one_thread_\fC [private]\fR
.PP
An auto event is used so that we can <signal> it to wakeup one thread up (e.g., when the <notify> method is called).
.PP
.SH AUTHOR
.PP
Generated automatically by Doxygen for ACE from the source code.
|