ACE
6.3.3
|
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. More... | |
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. More... | |
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) |
Public Member Functions inherited from ACE_WFMO_Reactor | |
ACE_WFMO_Reactor (ACE_Sig_Handler *=0, ACE_Timer_Queue *=0, ACE_Reactor_Notify *=0) | |
Initialize ACE_WFMO_Reactor with the default size. More... | |
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);. More... | |
virtual int | set_sig_handler (ACE_Sig_Handler *signal_handler) |
Use a user specified signal handler instead. More... | |
virtual int | timer_queue (ACE_Timer_Queue *tq) |
Set a user-specified timer queue. More... | |
virtual ACE_Timer_Queue * | timer_queue (void) const |
Return the current ACE_Timer_Queue. More... | |
virtual int | close (void) |
Close down the ACE_WFMO_Reactor and release all of its resources. More... | |
virtual | ~ACE_WFMO_Reactor (void) |
Close down the ACE_WFMO_Reactor and release all of its resources. More... | |
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. More... | |
virtual int | suspend_handler (ACE_Event_Handler *event_handler) |
virtual int | suspend_handler (ACE_HANDLE handle) |
Suspend handle temporarily. More... | |
virtual int | suspend_handler (const ACE_Handle_Set &handles) |
Suspend all handles in handle set temporarily. More... | |
virtual int | suspend_handlers (void) |
Suspend all handles temporarily. More... | |
virtual int | resume_handler (ACE_Event_Handler *event_handler) |
virtual int | resume_handler (ACE_HANDLE handle) |
Resume handle. More... | |
virtual int | resume_handler (const ACE_Handle_Set &handles) |
Resume all handles in handle set. More... | |
virtual int | resume_handlers (void) |
Resume all <handles>. More... | |
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. More... | |
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. More... | |
virtual bool | restart (void) |
Get the existing restart value. More... | |
virtual bool | restart (bool r) |
Set a new value for restart and return the original value. More... | |
virtual void | requeue_position (int) |
Not implemented. More... | |
virtual int | requeue_position (void) |
Not implemented. More... | |
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. More... | |
virtual int | ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask, int ops) |
Not implemented. More... | |
virtual void | dump (void) const |
Dump the state of an object. More... | |
Public Member Functions inherited from ACE_Reactor_Impl | |
virtual | ~ACE_Reactor_Impl (void) |
Close down and release all resources. More... | |
Protected Member Functions | |
virtual DWORD | wait_for_multiple_events (int timeout, int alertable) |
Wait for timer and I/O events to occur. More... | |
virtual DWORD | poll_remaining_handles (DWORD index) |
Check for activity on remaining handles. More... | |
virtual int | dispatch_window_messages (void) |
Dispatches window messages. More... | |
Protected Member Functions inherited from ACE_WFMO_Reactor | |
virtual int | register_handler_i (ACE_HANDLE event_handle, ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) |
Registration workhorse. More... | |
virtual int | event_handling (ACE_Time_Value *max_wait_time=0, int alertable=0) |
Event handling workhorse. More... | |
virtual int | mask_ops_i (ACE_HANDLE io_handle, ACE_Reactor_Mask masks, int operation) |
Bit masking workhorse. More... | |
virtual ACE_thread_t | owner_i (void) |
Return the ID of the "owner" thread. Does not do any locking. More... | |
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. More... | |
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. More... | |
virtual int | update_state (void) |
Update the state of the handler repository. More... | |
virtual int | new_owner (void) |
Check to see if we have a new owner. More... | |
virtual int | change_owner (void) |
Set owner to new owner. More... | |
Additional Inherited Members | |
Public Types inherited from ACE_WFMO_Reactor | |
enum | { DEFAULT_SIZE = MAXIMUM_WAIT_OBJECTS - 2 } |
Public Attributes inherited from ACE_WFMO_Reactor | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Public Attributes inherited from ACE_Reactor_Impl | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Protected Attributes inherited from ACE_WFMO_Reactor | |
ACE_Sig_Handler * | signal_handler_ |
Handle signals without requiring global/static variables. More... | |
bool | delete_signal_handler_ |
ACE_Timer_Queue * | timer_queue_ |
Defined as a pointer to allow overriding by derived classes... More... | |
bool | delete_timer_queue_ |
bool | delete_handler_rep_ |
Keeps track of whether we should delete the handler repository. More... | |
ACE_Reactor_Notify * | notify_handler_ |
Used when <notify> is called. More... | |
bool | delete_notify_handler_ |
Keeps track of whether we should delete the notify handler. More... | |
ACE_Process_Mutex | lock_ |
ACE_Lock_Adapter< ACE_Process_Mutex > | lock_adapter_ |
Adapter used to return internal lock to outside world. More... | |
ACE_WFMO_Reactor_Handler_Repository | handler_rep_ |
Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s. More... | |
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. More... | |
ACE_Auto_Event | waiting_to_change_state_ |
size_t | active_threads_ |
Count of currently active threads. More... | |
ACE_thread_t | owner_ |
ACE_thread_t | new_owner_ |
The owner to be of the WFMO_Reactor. More... | |
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. More... | |
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.