#include <Event_Handler.h>
Inheritance diagram for ACE_Event_Handler
Public Types | |
enum | { LO_PRIORITY = 0, HI_PRIORITY = 10, NULL_MASK = 0, READ_MASK = (1 << 0), WRITE_MASK = (1 << 1), EXCEPT_MASK = (1 << 2), ACCEPT_MASK = (1 << 3), CONNECT_MASK = (1 << 4), TIMER_MASK = (1 << 5), QOS_MASK = (1 << 6), GROUP_QOS_MASK = (1 << 7), SIGNAL_MASK = (1 << 8), ALL_EVENTS_MASK = READ_MASK | WRITE_MASK | EXCEPT_MASK | ACCEPT_MASK | CONNECT_MASK | TIMER_MASK | QOS_MASK | GROUP_QOS_MASK | SIGNAL_MASK, RWE_MASK = READ_MASK | WRITE_MASK | EXCEPT_MASK, DONT_CALL = (1 << 9) } |
Public Methods | |
virtual | ~ACE_Event_Handler (void) |
Destructor is virtual to enable proper cleanup. | |
virtual ACE_HANDLE | get_handle (void) const |
Get the I/O handle. Set the I/O handle. | |
virtual void | set_handle (ACE_HANDLE) |
virtual int | priority (void) const |
Get the priority of the Event_Handler. Set the priority of the Event_Handler. | |
virtual void | priority (int priority) |
virtual int | handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE) |
Called when input events occur (e.g., connection or data). | |
virtual int | handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE) |
Called when output events are possible (e.g., when flow control abates or non-blocking connection completes). | |
virtual int | handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE) |
Called when an exceptional events occur (e.g., SIGURG). | |
virtual int | handle_timeout (const ACE_Time_Value ¤t_time, const void *act = 0) |
virtual int | handle_exit (ACE_Process *) |
Called when a process exits. | |
virtual int | handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) |
Called when a <handle_*()> method returns -1 or when the <remove_handler> method is called on an . The <close_mask> indicates which event has triggered the <handle_close> method callback on a particular <handle>. | |
virtual int | handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0) |
Called when object is signaled by OS (either via UNIX signals or when a Win32 object becomes signaled). | |
virtual int | resume_handler (void) |
Called to figure out whether the handler needs to resumed by the reactor or the application can take care of it. The default value of 0 would be returned which would allow the reactor to take care of resumption of the handler. The application can return a value more than zero and decide to resume the handler themseleves. | |
virtual int | handle_qos (ACE_HANDLE = ACE_INVALID_HANDLE) |
virtual int | handle_group_qos (ACE_HANDLE = ACE_INVALID_HANDLE) |
virtual void | reactor (ACE_Reactor *reactor) |
virtual ACE_Reactor* | reactor (void) const |
Static Public Methods | |
void* | read_adapter (void *event_handler) |
int | register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, int flags = THR_DETACHED) |
int | remove_stdin_handler (ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr) |
Performs the inverse of the <register_stdin_handler> method. | |
Protected Methods | |
ACE_Event_Handler (ACE_Reactor * = 0, int priority = ACE_Event_Handler::LO_PRIORITY) | |
Force ACE_Event_Handler to be an abstract base class. | |
Private Attributes | |
int | priority_ |
Priority of this Event_Handler. | |
ACE_Reactor* | reactor_ |
Subclasses read/write input/output on an I/O descriptor, handle an exception raised on an I/O descriptor, handle a timer's expiration, or handle a signal.
|
|
|
Destructor is virtual to enable proper cleanup.
|
|
Force ACE_Event_Handler to be an abstract base class.
|
|
Get the I/O handle. Set the I/O handle.
Reimplemented in ACE_Acceptor, ACE_Strategy_Acceptor, ACE_Oneshot_Acceptor, ACE_Name_Proxy, ACE_POSIX_Proactor, ACE_Proactor_Impl, ACE_Service_Manager, ACE_Svc_Handler, ACE_WFMO_Reactor_Notify, and ACE_WIN32_Proactor. |
|
Called when a <handle_*()> method returns -1 or when the <remove_handler> method is called on an . The <close_mask> indicates which event has triggered the <handle_close> method callback on a particular <handle>.
Reimplemented in ACE_Acceptor, ACE_Strategy_Acceptor, ACE_Oneshot_Acceptor, ACE_Connector, ACE_Service_Manager, ACE_Svc_Handler, and ACE_WIN32_Proactor. |
|
Called when an exceptional events occur (e.g., SIGURG).
Reimplemented in ACE_Connector. |
|
Called when a process exits.
|
|
|
|
Called when input events occur (e.g., connection or data).
Reimplemented in ACE_Acceptor, ACE_Oneshot_Acceptor, ACE_Connector, ACE_POSIX_Asynch_Accept_Handler, ACE_Select_Reactor_Notify, and ACE_Service_Manager. |
|
Called when output events are possible (e.g., when flow control abates or non-blocking connection completes).
Reimplemented in ACE_Connector. |
|
|
|
Called when object is signaled by OS (either via UNIX signals or when a Win32 object becomes signaled).
Reimplemented in ACE_Strategy_Acceptor, ACE_Shared_Memory_Pool, ACE_MMAP_Memory_Pool, ACE_Process_Manager, ACE_Service_Manager, ACE_Sig_Adapter, ACE_Test_and_Set, ACE_Async_Timer_Queue_Adapter, ACE_Wakeup_All_Threads_Handler, ACE_WFMO_Reactor_Notify, and ACE_WIN32_Proactor. |
|
Called when timer expires. <current_time> represents the current time that the <Event_Handler> was selected for timeout dispatching and is the asynchronous completion token that was passed in when <schedule_timer> was invoked. Reimplemented in ACE_Oneshot_Acceptor, ACE_Connector, ACE_Logging_Strategy, ACE_Svc_Handler, and ACE_Buffered_Svc_Handler. |
|
|
|
Get the priority of the Event_Handler. Set the priority of the Event_Handler.
|
|
|
|
|
|
Used to read from non-socket ACE_HANDLEs in our own thread to work around Win32 limitations that don't allow us to <select> on non-sockets (such as ACE_STDIN). This is commonly used in situations where the Reactor is used to demultiplex read events on ACE_STDIN on UNIX. Note that <event_handler> must be a subclass of . If the <get_handle> method of this event handler returns we default to reading from ACE_STDIN. |
|
Abstracts away from the differences between Win32 and ACE with respect to reading from ACE_STDIN (which is non-<select>'able on Win32. |
|
Performs the inverse of the <register_stdin_handler> method.
|
|
Called to figure out whether the handler needs to resumed by the reactor or the application can take care of it. The default value of 0 would be returned which would allow the reactor to take care of resumption of the handler. The application can return a value more than zero and decide to resume the handler themseleves.
|
|
Reimplemented in ACE_Svc_Handler. |
|
Priority of this Event_Handler.
|
|
Reimplemented in ACE_Name_Proxy, and ACE_POSIX_Asynch_Accept_Handler. |