|
ACE 8.0.5
|
This class simply defines how Select_Reactor's basic interface functions should look like and provides a common base class for Select_Reactor using various locking mechanism.
More...
#include <Select_Reactor_Base.h>


Public Types | |
| enum | { DEFAULT_SIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE } |
Public Member Functions | |
| ACE_Select_Reactor_Impl (bool mask_signals=true) | |
| Constructor. | |
| virtual int | purge_pending_notifications (ACE_Event_Handler *=0, ACE_Reactor_Mask=ACE_Event_Handler::ALL_EVENTS_MASK) |
| virtual int | resumable_handler () |
| Public Member Functions inherited from ACE_Reactor_Impl | |
| virtual | ~ACE_Reactor_Impl () |
| Close down and release all resources. | |
| virtual int | open (size_t size, bool restart=false, ACE_Sig_Handler *=0, ACE_Timer_Queue *=0, int disable_notify_pipe=0, ACE_Reactor_Notify *=0)=0 |
| Initialization. | |
| virtual int | current_info (ACE_HANDLE, size_t &)=0 |
| virtual int | set_sig_handler (ACE_Sig_Handler *signal_handler)=0 |
| Use a user specified signal handler instead. | |
| virtual int | timer_queue (ACE_Timer_Queue *tq)=0 |
| Set a user-specified timer queue. | |
| virtual ACE_Timer_Queue * | timer_queue () const =0 |
| Return the current ACE_Timer_Queue. | |
| virtual int | close ()=0 |
| Close down and release all resources. | |
| virtual int | work_pending (const ACE_Time_Value &max_wait_time=ACE_Time_Value::zero)=0 |
| virtual int | handle_events (ACE_Time_Value *max_wait_time=0)=0 |
| virtual int | alertable_handle_events (ACE_Time_Value *max_wait_time=0)=0 |
| 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 | deactivated ()=0 |
| virtual void | deactivate (int do_stop)=0 |
| virtual int | register_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)=0 |
| virtual int | register_handler (ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)=0 |
| virtual int | register_handler (ACE_Event_Handler *event_handler, ACE_HANDLE event_handle=ACE_INVALID_HANDLE)=0 |
| virtual int | register_handler (ACE_HANDLE event_handle, ACE_HANDLE io_handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)=0 |
| virtual int | register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)=0 |
| Register event_handler with all the handles in the Handle_Set. | |
| 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)=0 |
| virtual int | register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp=0)=0 |
| virtual int | remove_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)=0 |
| virtual int | remove_handler (ACE_HANDLE handle, ACE_Reactor_Mask mask)=0 |
| virtual int | remove_handler (const ACE_Handle_Set &handle_set, ACE_Reactor_Mask mask)=0 |
| virtual int | remove_handler (int signum, ACE_Sig_Action *new_disp, ACE_Sig_Action *old_disp=0, int sigkey=-1)=0 |
| virtual int | remove_handler (const ACE_Sig_Set &sigset)=0 |
| Calls remove_handler() for every signal in sigset. | |
| virtual int | suspend_handler (ACE_Event_Handler *event_handler)=0 |
| virtual int | suspend_handler (ACE_HANDLE handle)=0 |
| Suspend handle temporarily. | |
| virtual int | suspend_handler (const ACE_Handle_Set &handles)=0 |
| Suspend all handles in handle set temporarily. | |
| virtual int | suspend_handlers ()=0 |
| Suspend all <handles> temporarily. | |
| virtual int | resume_handler (ACE_Event_Handler *event_handler)=0 |
| virtual int | resume_handler (ACE_HANDLE handle)=0 |
| Resume handle. | |
| virtual int | resume_handler (const ACE_Handle_Set &handles)=0 |
| Resume all handles in handle set. | |
| virtual int | resume_handlers ()=0 |
| Resume all handles. | |
| virtual bool | uses_event_associations ()=0 |
| 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)=0 |
| virtual int | reset_timer_interval (long timer_id, const ACE_Time_Value &interval)=0 |
| virtual int | cancel_timer (ACE_Event_Handler *event_handler, int dont_call_handle_close=1)=0 |
| virtual int | notify (ACE_Event_Handler *event_handler=0, ACE_Reactor_Mask mask=ACE_Event_Handler::EXCEPT_MASK, ACE_Time_Value *=0)=0 |
| virtual void | max_notify_iterations (int)=0 |
| virtual int | max_notify_iterations ()=0 |
| virtual ACE_Event_Handler * | find_handler (ACE_HANDLE handle)=0 |
| virtual int | handler (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Event_Handler **event_handler=0)=0 |
| virtual int | handler (int signum, ACE_Event_Handler **=0)=0 |
| virtual bool | initialized ()=0 |
| Returns true if Reactor has been successfully initialized, else false. | |
| virtual size_t | size () const =0 |
| Returns the current size of the Reactor's internal descriptor table. | |
| virtual ACE_Lock & | lock ()=0 |
| Returns a reference to the Reactor's internal lock. | |
| virtual void | wakeup_all_threads ()=0 |
| Wake up all threads in waiting in the event loop. | |
| virtual int | owner (ACE_thread_t new_owner, ACE_thread_t *old_owner=0)=0 |
| Transfers ownership of Reactor_Impl to the new_owner. | |
| virtual int | owner (ACE_thread_t *owner)=0 |
| Return the ID of the "owner" thread. | |
| virtual bool | restart ()=0 |
| Get the existing restart value. | |
| virtual bool | restart (bool r)=0 |
| Set a new value for restart and return the original value. | |
| virtual void | requeue_position (int)=0 |
| Set position of the owner thread. | |
| virtual int | requeue_position ()=0 |
| Get position of the owner thread. | |
| virtual int | mask_ops (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask, int ops)=0 |
| GET/SET/ADD/CLR the dispatch mask "bit" bound with the event_handler and mask. | |
| virtual int | mask_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, int ops)=0 |
| GET/SET/ADD/CLR the dispatch MASK "bit" bound with the handle and mask. | |
| virtual int | ready_ops (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask, int ops)=0 |
| GET/SET/ADD/CLR the ready "bit" bound with the event_handler and mask. | |
| virtual int | ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask, int ops)=0 |
| GET/SET/ADD/CLR the ready "bit" bound with the handle and mask. | |
| virtual void | dump () const =0 |
| Dump the state of an object. | |
Protected Member Functions | |
| virtual int | bit_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Select_Reactor_Handle_Set &handle_set, int ops) |
| Allow manipulation of the <wait_set_> mask and <ready_set_> mask. | |
| virtual void | renew ()=0 |
| virtual int | is_suspended_i (ACE_HANDLE handle)=0 |
| virtual void | clear_dispatch_mask (ACE_HANDLE handle, ACE_Reactor_Mask mask) |
| bool | supress_notify_renew () |
| void | supress_notify_renew (bool sr) |
Protected Attributes | |
| ACE_Select_Reactor_Handler_Repository | handler_rep_ |
| Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s. | |
| ACE_Select_Reactor_Handle_Set | dispatch_set_ |
| Tracks handles that are ready for dispatch from <select>. | |
| ACE_Select_Reactor_Handle_Set | wait_set_ |
| Tracks handles that are waited for by <select>. | |
| ACE_Select_Reactor_Handle_Set | suspend_set_ |
| Tracks handles that are currently suspended. | |
| ACE_Select_Reactor_Handle_Set | ready_set_ |
| ACE_Timer_Queue * | timer_queue_ |
| Defined as a pointer to allow overriding by derived classes... | |
| ACE_Sig_Handler * | signal_handler_ |
| Handle signals without requiring global/static variables. | |
| ACE_Reactor_Notify * | notify_handler_ |
| bool | delete_timer_queue_ |
| bool | delete_signal_handler_ |
| bool | delete_notify_handler_ |
| bool | initialized_ |
| True if we've been initialized yet... | |
| bool | restart_ |
| int | requeue_position_ |
| ACE_thread_t | owner_ |
| The original thread that created this Select_Reactor. | |
| bool | state_changed_ |
| bool | mask_signals_ |
Private Member Functions | |
| ACE_Select_Reactor_Impl (const ACE_Select_Reactor_Impl &)=delete | |
| ACE_Select_Reactor_Impl & | operator= (const ACE_Select_Reactor_Impl &)=delete |
Private Attributes | |
| bool | supress_renew_ |
Friends | |
| class | ACE_Select_Reactor_Notify |
| class | ACE_Select_Reactor_Handler_Repository |
Additional Inherited Members | |
| Public Attributes inherited from ACE_Reactor_Impl | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
This class simply defines how Select_Reactor's basic interface functions should look like and provides a common base class for Select_Reactor using various locking mechanism.
|
inline |
Constructor.
|
privatedelete |
|
protectedvirtual |
Allow manipulation of the <wait_set_> mask and <ready_set_> mask.
|
protectedvirtual |
When register/unregister occur, then we need to re-eval our wait/suspend/dispatch set.
Reimplemented in ACE_TP_Reactor.
|
protectedpure virtual |
Check to see if the Event_Handler associated with handle is suspended. Returns 0 if not, 1 if so.
Implemented in ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >, and ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
|
privatedelete |
|
virtual |
Purge any notifications pending in this reactor for the specified ACE_Event_Handler object. Returns the number of notifications purged. Returns -1 on error.
Implements ACE_Reactor_Impl.
|
protectedpure virtual |
Enqueue ourselves into the list of waiting threads at the appropriate point specified by <requeue_position_>.
Implemented in ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >, and ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
|
virtual |
Does the reactor allow the application to resume the handle on its own ie. can it pass on the control of handle resumption to the application. The select reactor has no handlers that can be resumed by the application. So return 0;
Implements ACE_Reactor_Impl.
Reimplemented in ACE_TP_Reactor.
|
inlineprotected |
Controls/access whether the notify handler should renew the Select_Reactor's token or not.
|
inlineprotected |
|
friend |
|
friend |
|
protected |
Keeps track of whether we need to delete the notify handler (if we didn't create it, then we don't delete it).
|
protected |
Keeps track of whether we should delete the signal handler (if we didn't create it, then we don't delete it).
|
protected |
Keeps track of whether we should delete the timer queue (if we didn't create it, then we don't delete it).
|
protected |
Tracks handles that are ready for dispatch from <select>.
|
protected |
Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s.
|
protected |
True if we've been initialized yet...
|
protected |
If false then the Reactor will not mask the signals during the event dispatching. This is useful for applications that do not register any signal handlers and want to reduce the overhead introduce by the kernel level locks required to change the mask.
|
protected |
Callback object that unblocks the ACE_Select_Reactor if it's sleeping.
|
protected |
The original thread that created this Select_Reactor.
|
protected |
Track HANDLES we are interested in for various events that must be dispatched without going through <select>.
|
protected |
Position that the main ACE_Select_Reactor thread is requeued in the list of waiters during a <notify> callback. If this value == -1 we are requeued at the end of the list. Else if it's 0 then we are requeued at the front of the list. Else if it's > 1 then that indicates the number of waiters to skip over.
|
protected |
Restart the <handle_events> event-loop method automatically when <select> is interrupted via <EINTR>.
|
protected |
Handle signals without requiring global/static variables.
|
protected |
True if state has changed during dispatching of ACE_Event_Handlers, else false. This is used to determine whether we need to make another trip through the <Select_Reactor>'s <wait_for_multiple_events> loop.
|
private |
Determine whether we should renew Select_Reactor's token after handling the notification message.
|
protected |
Tracks handles that are currently suspended.
|
protected |
Defined as a pointer to allow overriding by derived classes...
|
protected |
Tracks handles that are waited for by <select>.