2 #ifndef ACE_EVENT_HANDLER_T_CPP
3 #define ACE_EVENT_HANDLER_T_CPP
5 #include "ace/Event_Handler_T.h"
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #if !defined (__ACE_INLINE__)
12 #include "ace/Event_Handler_T.inl"
13 #endif /* __ACE_INLINE__ */
15 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
17 ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_T
)
19 template <class T
> void
20 ACE_Event_Handler_T
<T
>::dump () const
22 #if defined (ACE_HAS_DUMP)
23 ACE_TRACE ("ACE_Event_Handler_T<T>::dump");
24 #endif /* ACE_HAS_DUMP */
28 ACE_Event_Handler_T
<T
>::~ACE_Event_Handler_T ()
30 ACE_TRACE ("ACE_Event_Handler_T<T>::~ACE_Event_Handler_T");
31 if (this->delete_handler_
)
32 delete this->op_handler_
;
36 ACE_Event_Handler_T
<T
>::ACE_Event_Handler_T (T
*op_handler
, int delete_handler
,
37 GET_HANDLE get_handle
,
43 SET_HANDLE set_handle
,
45 : op_handler_ (op_handler
),
46 input_handler_ (input_h
),
47 output_handler_ (output_h
),
48 except_handler_ (except_h
),
49 to_handler_ (timeout_h
),
50 cl_handler_ (close_h
),
52 delete_handler_ (delete_handler
),
53 set_handle_ (set_handle
),
54 get_handle_ (get_handle
)
56 ACE_TRACE ("ACE_Event_Handler_T<T>::ACE_Event_Handler_T");
59 template<class T
> ACE_HANDLE
60 ACE_Event_Handler_T
<T
>::get_handle () const
62 ACE_TRACE ("ACE_Event_Handler_T<T>::get_handle");
63 return this->get_handle_
== 0 ? ACE_INVALID_HANDLE
: (this->op_handler_
->*get_handle_
) ();
66 template<class T
> void
67 ACE_Event_Handler_T
<T
>::set_handle (ACE_HANDLE h
)
69 ACE_TRACE ("ACE_Event_Handler_T<T>::set_handle");
70 if (this->set_handle_
!= 0)
71 (this->op_handler_
->*set_handle_
) (h
);
75 ACE_Event_Handler_T
<T
>::handle_input (ACE_HANDLE fd
)
77 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_input");
78 return this->input_handler_
== 0 ? 0 : (this->op_handler_
->*input_handler_
) (fd
);
82 ACE_Event_Handler_T
<T
>::handle_output (ACE_HANDLE fd
)
84 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_output");
85 return this->output_handler_
== 0 ? 0 : (this->op_handler_
->*output_handler_
) (fd
);
89 ACE_Event_Handler_T
<T
>::handle_exception (ACE_HANDLE fd
)
91 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_exception");
92 return this->except_handler_
== 0 ? 0 : (this->op_handler_
->*except_handler_
) (fd
);
96 ACE_Event_Handler_T
<T
>::handle_timeout (const ACE_Time_Value
&tv
, const void *arg
)
98 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_timeout");
99 return this->to_handler_
== 0 ? 0 : (this->op_handler_
->*to_handler_
) (tv
, arg
);
102 template<class T
> int
103 ACE_Event_Handler_T
<T
>::handle_close (ACE_HANDLE fd
, ACE_Reactor_Mask close_mask
)
105 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_close");
106 return this->cl_handler_
== 0 ? 0 : (this->op_handler_
->*cl_handler_
) (fd
, close_mask
);
109 template<class T
> int
110 ACE_Event_Handler_T
<T
>::handle_signal (int signum
, siginfo_t
*s
, ucontext_t
*u
)
112 ACE_TRACE ("ACE_Event_Handler_T<T>::handle_signal");
113 return this->sig_handler_
== 0 ? 0 : (this->op_handler_
->*sig_handler_
) (signum
, s
, u
);
116 ACE_END_VERSIONED_NAMESPACE_DECL
118 #endif /* ACE_EVENT_HANDLER_T_CPP */