Provides an abstract interface for handling various types of I/O, timer, and signal events.
More...
#include <Event_Handler.h>
Inherited by ACE::Monitor_Control::Monitor_Point_Auto_Updater, ACE_Async_Timer_Queue_Adapter< TQ, TYPE >, ACE_Event_Handler_T< T >, ACE_MMAP_Memory_Pool, ACE_Name_Proxy, ACE_NonBlocking_Connect_Handler< SVC_HANDLER >, ACE_POSIX_Asynch_Accept, ACE_POSIX_Asynch_Connect, ACE_Proactor_Impl, ACE_Process_Manager [protected]
, ACE_Reactor_Notify, ACE_Service_Object, ACE_Shared_Memory_Pool, ACE_Sig_Adapter, ACE_Test_and_Set< ACE_LOCK, TYPE >, and ACE_Wakeup_All_Threads_Handler.
List of all members.
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,
RWE_MASK,
DONT_CALL = (1 << 9)
} |
enum | { ACE_EVENT_HANDLER_NOT_RESUMED = -1,
ACE_REACTOR_RESUMES_HANDLER = 0,
ACE_APPLICATION_RESUMES_HANDLER
} |
typedef long | Reference_Count |
| Reference count type.
|
Detailed Description
Provides an abstract interface for handling various types of I/O, timer, and signal events.
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.
Member Typedef Documentation
Typedef for implementation of reference counting.
Member Enumeration Documentation
- Enumerator:
ACE_EVENT_HANDLER_NOT_RESUMED |
The handler is not resumed at all. Could lead to deadlock..
|
ACE_REACTOR_RESUMES_HANDLER |
The reactor takes responsibility of resuming the handler and is the default
|
ACE_APPLICATION_RESUMES_HANDLER |
The application takes responsibility of resuming the handler.
|
- Enumerator:
LO_PRIORITY |
|
HI_PRIORITY |
|
NULL_MASK |
|
READ_MASK |
|
WRITE_MASK |
|
EXCEPT_MASK |
|
ACCEPT_MASK |
|
CONNECT_MASK |
|
TIMER_MASK |
|
QOS_MASK |
|
GROUP_QOS_MASK |
|
SIGNAL_MASK |
|
ALL_EVENTS_MASK |
|
RWE_MASK |
|
DONT_CALL |
|
Constructor & Destructor Documentation
ACE_Event_Handler::~ACE_Event_Handler |
( |
void |
| ) |
|
|
virtual |
Destructor is virtual to enable proper cleanup.
Member Function Documentation
Increment reference count on the handler.
This method is called when the handler is registered with the Reactor and when the Reactor makes an upcall on the handler. Reference count is 1 when the handler is created.
- Returns:
- Current reference count.
ACE_HANDLE ACE_Event_Handler::get_handle |
( |
void |
| ) |
const |
|
virtual |
Get the I/O handle.
Reimplemented in ACE_POSIX_Asynch_Connect, ACE_POSIX_Asynch_Accept, ACE_Oneshot_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_WFMO_Reactor_Notify, ACE_Strategy_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >, ACE_POSIX_Proactor, ACE_Svc_Handler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >, ACE_Svc_Handler< ACE_PEER_STREAM_2, ACE_SYNCH_USE >, ACE_WIN32_Proactor, ACE_Event_Handler_T< T >, ACE_Service_Manager, ACE_Proactor_Impl, and ACE_Name_Proxy.
int ACE_Event_Handler::handle_close |
( |
ACE_HANDLE |
handle, |
|
|
ACE_Reactor_Mask |
close_mask |
|
) |
| |
|
virtual |
Called when a handle_*() method returns -1 or when the remove_handler() method is called on an ACE_Reactor. The close_mask indicates which event has triggered the handle_close() method callback on a particular handle.
Reimplemented in ACE_POSIX_Asynch_Connect, ACE_POSIX_Asynch_Accept, ACE_Oneshot_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Strategy_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_WIN32_Proactor, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >, ACE_Svc_Handler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >, ACE_Svc_Handler< ACE_PEER_STREAM_2, ACE_SYNCH_USE >, ACE_Logging_Strategy, ACE_Event_Handler_T< T >, ACE_NonBlocking_Connect_Handler< SVC_HANDLER >, and ACE_Service_Manager.
int ACE_Event_Handler::handle_exception |
( |
ACE_HANDLE |
fd = ACE_INVALID_HANDLE | ) |
|
|
virtual |
Called when a process exits.
int ACE_Event_Handler::handle_group_qos |
( |
ACE_HANDLE |
= ACE_INVALID_HANDLE | ) |
|
|
virtual |
int ACE_Event_Handler::handle_input |
( |
ACE_HANDLE |
fd = ACE_INVALID_HANDLE | ) |
|
|
virtual |
Called when input events occur (e.g., connection or data).
Reimplemented in ACE_POSIX_Asynch_Accept, ACE_Oneshot_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >, ACE_Select_Reactor_Notify, ACE_Dev_Poll_Reactor_Notify, ACE_NonBlocking_Connect_Handler< SVC_HANDLER >, ACE_Event_Handler_T< T >, and ACE_Service_Manager.
int ACE_Event_Handler::handle_output |
( |
ACE_HANDLE |
fd = ACE_INVALID_HANDLE | ) |
|
|
virtual |
int ACE_Event_Handler::handle_qos |
( |
ACE_HANDLE |
= ACE_INVALID_HANDLE | ) |
|
|
virtual |
Called when object is signaled by OS (either via UNIX signals or when a Win32 object becomes signaled).
Reimplemented in ACE_WFMO_Reactor_Notify, ACE_Strategy_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Process_Manager, ACE_WIN32_Proactor, ACE_Shared_Memory_Pool, ACE_Event_Handler_T< T >, ACE_Service_Manager, ACE_Async_Timer_Queue_Adapter< TQ, TYPE >, ACE_Wakeup_All_Threads_Handler, ACE_Test_and_Set< ACE_LOCK, TYPE >, and ACE_Sig_Adapter.
int ACE_Event_Handler::handle_timeout |
( |
const ACE_Time_Value & |
current_time, |
|
|
const void * |
act = 0 |
|
) |
| |
|
virtual |
Called when timer expires. current_time represents the current time that the Event_Handler was selected for timeout dispatching and act is the asynchronous completion token that was passed in when <schedule_timer> was invoked.
Reimplemented in ACE_Oneshot_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >, ACE_Buffered_Svc_Handler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >, ACE_Svc_Handler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >, ACE_Svc_Handler< ACE_PEER_STREAM_2, ACE_SYNCH_USE >, ACE_NonBlocking_Connect_Handler< SVC_HANDLER >, ACE_Event_Handler_T< T >, ACE_Logging_Strategy, and ACE::Monitor_Control::Monitor_Point_Auto_Updater.
int ACE_Event_Handler::priority |
( |
void |
| ) |
const |
|
virtual |
Get the priority of the Event_Handler.
- Note:
- Priorities run from MIN_PRIORITY (which is the "lowest priority") to MAX_PRIORITY (which is the "highest priority").
void ACE_Event_Handler::priority |
( |
int |
priority | ) |
|
|
virtual |
Set the priority of the Event_Handler.
void ACE_Event_Handler::reactor |
( |
ACE_Reactor * |
reactor | ) |
|
|
virtual |
ACE_Reactor * ACE_Event_Handler::reactor |
( |
void |
| ) |
const |
|
virtual |
Get only the reactor's timer related interface.
ACE_THR_FUNC_RETURN ACE_Event_Handler::read_adapter |
( |
void * |
event_handler | ) |
|
|
static |
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 ACE_Event_Handler. If the get_handle() method of this event handler returns ACE_INVALID_HANDLE 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.
Decrement reference count on the handler.
This method is called when the handler is removed from the Reactor and when an upcall made on the handler by the Reactor completes. Handler is deleted when the reference count reaches 0.
- Returns:
- Current reference count.
int ACE_Event_Handler::resume_handler |
( |
void |
| ) |
|
|
virtual |
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 themselves.
- Note:
- This method has an affect only when used with the ACE_Dev_Poll_Reactor (and then, only on Linux) or the ACE_TP_Reactor.
Reimplemented in ACE_NonBlocking_Connect_Handler< SVC_HANDLER >.
void ACE_Event_Handler::set_handle |
( |
ACE_HANDLE |
| ) |
|
|
virtual |
Member Data Documentation
int ACE_Event_Handler::priority_ |
|
private |
Priority of this Event_Handler.
Reference counting requirements.
The documentation for this class was generated from the following files: