ACE
6.1.6
|
An OO event demultiplexor and event handler dispatcher for Win32 <MsgWaitForMultipleObjects>. More...
#include <Msg_WFMO_Reactor.h>
Public Member Functions | |
ACE_Msg_WFMO_Reactor (ACE_Sig_Handler *=0, ACE_Timer_Queue *=0) | |
Initialize <ACE_Msg_WFMO_Reactor> with the default size. | |
ACE_Msg_WFMO_Reactor (size_t size, int unused=0, ACE_Sig_Handler *=0, ACE_Timer_Queue *=0) | |
virtual | ~ACE_Msg_WFMO_Reactor (void) |
Close down the ACE_Msg_WFMO_Reactor and release all of its resources. | |
virtual int | handle_events (ACE_Time_Value *max_wait_time=0) |
virtual int | alertable_handle_events (ACE_Time_Value *max_wait_time=0) |
virtual int | handle_events (ACE_Time_Value &max_wait_time) |
virtual int | alertable_handle_events (ACE_Time_Value &max_wait_time) |
![]() | |
ACE_WFMO_Reactor (ACE_Sig_Handler *=0, ACE_Timer_Queue *=0, ACE_Reactor_Notify *=0) | |
Initialize ACE_WFMO_Reactor with the default size. | |
ACE_WFMO_Reactor (size_t size, int unused=0, ACE_Sig_Handler *=0, ACE_Timer_Queue *=0, ACE_Reactor_Notify *=0) | |
virtual int | open (size_t size=ACE_WFMO_Reactor::DEFAULT_SIZE, bool restart=false, ACE_Sig_Handler *=0, ACE_Timer_Queue *=0, int disable_notify_pipe=0, ACE_Reactor_Notify *=0) |
virtual int | current_info (ACE_HANDLE, size_t &) |
Returns -1 (not used in this implementation);. | |
virtual int | set_sig_handler (ACE_Sig_Handler *signal_handler) |
Use a user specified signal handler instead. | |
virtual int | timer_queue (ACE_Timer_Queue *tq) |
Set a user-specified timer queue. | |
virtual ACE_Timer_Queue * | timer_queue (void) const |
Return the current ACE_Timer_Queue. | |
virtual int | close (void) |
Close down the ACE_WFMO_Reactor and release all of its resources. | |
virtual | ~ACE_WFMO_Reactor (void) |
Close down the ACE_WFMO_Reactor and release all of its resources. | |
virtual int | work_pending (const ACE_Time_Value &max_wait_time=ACE_Time_Value::zero) |
virtual int | deactivated (void) |
virtual void | deactivate (int do_stop) |
virtual int | register_handler (ACE_Event_Handler *event_handler, ACE_HANDLE event_handle=ACE_INVALID_HANDLE) |
virtual int | register_handler (ACE_HANDLE event_handle, ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
virtual int | register_handler (ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
virtual int | register_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
virtual int | register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
virtual int | register_handler (int signum, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp=0, ACE_Event_Handler **old_sh=0, ACE_Sig_Action *old_disp=0) |
virtual int | register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp=0) |
virtual int | remove_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
virtual int | remove_handler (ACE_HANDLE handle, ACE_Reactor_Mask mask) |
virtual int | remove_handler (const ACE_Handle_Set &handle_set, ACE_Reactor_Mask) |
virtual int | remove_handler (int signum, ACE_Sig_Action *new_disp, ACE_Sig_Action *old_disp=0, int sigkey=-1) |
virtual int | remove_handler (const ACE_Sig_Set &sigset) |
Calls remove_handler() for every signal in sigset. | |
virtual int | suspend_handler (ACE_Event_Handler *event_handler) |
virtual int | suspend_handler (ACE_HANDLE handle) |
Suspend handle temporarily. | |
virtual int | suspend_handler (const ACE_Handle_Set &handles) |
Suspend all handles in handle set temporarily. | |
virtual int | suspend_handlers (void) |
Suspend all handles temporarily. | |
virtual int | resume_handler (ACE_Event_Handler *event_handler) |
virtual int | resume_handler (ACE_HANDLE handle) |
Resume handle. | |
virtual int | resume_handler (const ACE_Handle_Set &handles) |
Resume all handles in handle set. | |
virtual int | resume_handlers (void) |
Resume all <handles>. | |
virtual int | resumable_handler (void) |
virtual bool | uses_event_associations (void) |
virtual long | schedule_timer (ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, const ACE_Time_Value &interval=ACE_Time_Value::zero) |
virtual int | reset_timer_interval (long timer_id, const ACE_Time_Value &interval) |
virtual int | cancel_timer (ACE_Event_Handler *event_handler, int dont_call_handle_close=1) |
virtual int | cancel_timer (long timer_id, const void **arg=0, int dont_call_handle_close=1) |
virtual int | schedule_wakeup (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks_to_be_added) |
virtual int | schedule_wakeup (ACE_HANDLE handle, ACE_Reactor_Mask masks_to_be_added) |
virtual int | cancel_wakeup (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks_to_be_deleted) |
virtual int | cancel_wakeup (ACE_HANDLE handle, ACE_Reactor_Mask masks_to_be_deleted) |
virtual int | notify (ACE_Event_Handler *=0, ACE_Reactor_Mask=ACE_Event_Handler::EXCEPT_MASK, ACE_Time_Value *=0) |
virtual void | max_notify_iterations (int) |
virtual int | max_notify_iterations (void) |
virtual int | purge_pending_notifications (ACE_Event_Handler *=0, ACE_Reactor_Mask=ACE_Event_Handler::ALL_EVENTS_MASK) |
ACE_Event_Handler * | find_handler (ACE_HANDLE handle) |
virtual int | handler (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Event_Handler **event_handler=0) |
virtual int | handler (int signum, ACE_Event_Handler **=0) |
virtual bool | initialized (void) |
virtual size_t | size (void) const |
virtual ACE_Lock & | lock (void) |
Returns a reference to the WFMO_Reactor's internal lock. | |
virtual void | wakeup_all_threads (void) |
virtual int | owner (ACE_thread_t new_owner, ACE_thread_t *old_owner=0) |
virtual int | owner (ACE_thread_t *owner) |
Return the ID of the "owner" thread. | |
virtual bool | restart (void) |
Get the existing restart value. | |
virtual bool | restart (bool r) |
Set a new value for restart and return the original value. | |
virtual void | requeue_position (int) |
Not implemented. | |
virtual int | requeue_position (void) |
Not implemented. | |
virtual int | mask_ops (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks, int operation) |
virtual int | mask_ops (ACE_HANDLE handle, ACE_Reactor_Mask masks, int ops) |
virtual int | ready_ops (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask, int ops) |
Not implemented. | |
virtual int | ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask, int ops) |
Not implemented. | |
virtual void | dump (void) const |
Dump the state of an object. | |
![]() | |
virtual | ~ACE_Reactor_Impl (void) |
Close down and release all resources. |
Protected Member Functions | |
virtual DWORD | wait_for_multiple_events (int timeout, int alertable) |
Wait for timer and I/O events to occur. | |
virtual DWORD | poll_remaining_handles (DWORD index) |
Check for activity on remaining handles. | |
virtual int | dispatch_window_messages (void) |
Dispatches window messages. | |
![]() | |
virtual int | register_handler_i (ACE_HANDLE event_handle, ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
Registration workhorse. | |
virtual int | event_handling (ACE_Time_Value *max_wait_time=0, int alertable=0) |
Event handling workhorse. | |
virtual int | mask_ops_i (ACE_HANDLE io_handle, ACE_Reactor_Mask masks, int operation) |
Bit masking workhorse. | |
virtual ACE_thread_t | owner_i (void) |
Return the ID of the "owner" thread. Does not do any locking. | |
virtual int | ok_to_wait (ACE_Time_Value *max_wait_time, int alertable) |
virtual int | expire_timers (void) |
virtual int | dispatch (DWORD wait_status) |
Dispatches the timers and I/O handlers. | |
virtual int | safe_dispatch (DWORD wait_status) |
virtual int | dispatch_handles (DWORD slot) |
virtual int | dispatch_handler (DWORD slot, DWORD max_handlep1) |
virtual int | simple_dispatch_handler (DWORD slot, ACE_HANDLE event_handle) |
virtual int | complex_dispatch_handler (DWORD slot, ACE_HANDLE event_handle) |
virtual ACE_Reactor_Mask | upcall (ACE_Event_Handler *event_handler, ACE_HANDLE io_handle, WSANETWORKEVENTS &events) |
virtual int | calculate_timeout (ACE_Time_Value *time) |
Used to caluculate the next timeout. | |
virtual int | update_state (void) |
Update the state of the handler repository. | |
virtual int | new_owner (void) |
Check to see if we have a new owner. | |
virtual int | change_owner (void) |
Set owner to new owner. |
Additional Inherited Members | |
![]() | |
enum | { DEFAULT_SIZE = MAXIMUM_WAIT_OBJECTS - 2 } |
![]() | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
![]() | |
![]() | |
ACE_Sig_Handler * | signal_handler_ |
Handle signals without requiring global/static variables. | |
bool | delete_signal_handler_ |
ACE_Timer_Queue * | timer_queue_ |
Defined as a pointer to allow overriding by derived classes... | |
bool | delete_timer_queue_ |
bool | delete_handler_rep_ |
Keeps track of whether we should delete the handler repository. | |
ACE_Reactor_Notify * | notify_handler_ |
Used when <notify> is called. | |
bool | delete_notify_handler_ |
Keeps track of whether we should delete the notify handler. | |
ACE_Process_Mutex | lock_ |
ACE_Lock_Adapter < ACE_Process_Mutex > | lock_adapter_ |
Adapter used to return internal lock to outside world. | |
ACE_WFMO_Reactor_Handler_Repository | handler_rep_ |
Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s. | |
ACE_Manual_Event | ok_to_wait_ |
ACE_Manual_Event | wakeup_all_threads_ |
ACE_Wakeup_All_Threads_Handler | wakeup_all_threads_handler_ |
Used when <wakeup_all_threads_> is signaled. | |
ACE_Auto_Event | waiting_to_change_state_ |
size_t | active_threads_ |
Count of currently active threads. | |
ACE_thread_t | owner_ |
ACE_thread_t | new_owner_ |
The owner to be of the WFMO_Reactor. | |
ACE_thread_t | change_state_thread_ |
ACE_HANDLE | atomic_wait_array_ [2] |
bool | open_for_business_ |
This flag is used to keep track of whether we are already closed. | |
sig_atomic_t | deactivated_ |
An OO event demultiplexor and event handler dispatcher for Win32 <MsgWaitForMultipleObjects>.
The ACE_Msg_WFMO_Reactor is an OO event demultiplexor and event handler Reactor. It differs from <ACE_WFMO_Reactor> by its ability to react on Windows messages. It is needed when the task should serve also as a COM/DCOM server.
ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor | ( | ACE_Sig_Handler * | sh = 0 , |
ACE_Timer_Queue * | tq = 0 |
||
) |
Initialize <ACE_Msg_WFMO_Reactor> with the default size.
ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor | ( | size_t | size, |
int | unused = 0 , |
||
ACE_Sig_Handler * | sh = 0 , |
||
ACE_Timer_Queue * | tq = 0 |
||
) |
Initialize <ACE_Msg_WFMO_Reactor> with size size. Two slots will be added to the size parameter which will store handles used for internal management purposes.
|
virtual |
Close down the ACE_Msg_WFMO_Reactor and release all of its resources.
|
inlinevirtual |
Reimplemented from ACE_WFMO_Reactor.
|
inlinevirtual |
Reimplemented from ACE_WFMO_Reactor.
|
protectedvirtual |
Dispatches window messages.
Reimplemented from ACE_WFMO_Reactor.
|
inlinevirtual |
This event loop driver blocks for up to max_wait_time before returning. It will return earlier if timer events, I/O events, window events, or signal events occur. Note that max_wait_time can be 0, in which case this method blocks indefinitely until events occur.
max_wait_time is decremented to reflect how much time this call took. For instance, if a time value of 3 seconds is passed to handle_events and an event occurs after 2 seconds, max_wait_time will equal 1 second. This can be used if an application wishes to handle events for some fixed amount of time.
<MsgWaitForMultipleObjects> is used as the demultiplexing call
Returns the total number of ACE_Event_Handlers that were dispatched, 0 if the max_wait_time elapsed without dispatching any handlers, or -1 if an error occurs.
The only difference between <alertable_handle_events> and <handle_events> is that in the alertable case, MWMO_ALERTABLE is passed to <MsgWaitForMultipleObjects> for the <bAlertable> option.
Reimplemented from ACE_WFMO_Reactor.
|
inlinevirtual |
This method is just like the one above, except the max_wait_time value is a reference and can therefore never be NULL.
Reimplemented from ACE_WFMO_Reactor.
|
protectedvirtual |
Check for activity on remaining handles.
Reimplemented from ACE_WFMO_Reactor.
|
protectedvirtual |
Wait for timer and I/O events to occur.
Reimplemented from ACE_WFMO_Reactor.