Event_Handler_T.cpp

Go to the documentation of this file.
00001 // Event_Handler_T.cpp
00002 //
00003 // Event_Handler_T.cpp,v 4.8 2005/10/28 16:14:52 ossama Exp
00004 
00005 #ifndef ACE_EVENT_HANDLER_T_CPP
00006 #define ACE_EVENT_HANDLER_T_CPP
00007 
00008 #include "ace/Event_Handler_T.h"
00009 
00010 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00011 # pragma once
00012 #endif /* ACE_LACKS_PRAGMA_ONCE */
00013 
00014 #if defined (ACE_HAS_TEMPLATE_TYPEDEFS)
00015 
00016 #if !defined (__ACE_INLINE__)
00017 #include "ace/Event_Handler_T.inl"
00018 #endif /* __ACE_INLINE__ */
00019 
00020 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_T)
00023 
00024 template <class T> void
00025 ACE_Event_Handler_T<T>::dump (void) const
00026 {
00027 #if defined (ACE_HAS_DUMP)
00028   ACE_TRACE ("ACE_Event_Handler_T<T>::dump");
00029 #endif /* ACE_HAS_DUMP */
00030 }
00031 
00032 template<class T>
00033 ACE_Event_Handler_T<T>::~ACE_Event_Handler_T (void)
00034 {
00035   ACE_TRACE ("ACE_Event_Handler_T<T>::~ACE_Event_Handler_T");
00036   if (this->delete_handler_)
00037     delete this->op_handler_;
00038 }
00039 
00040 template <class T>
00041 ACE_Event_Handler_T<T>::ACE_Event_Handler_T (T *op_handler, int delete_handler,
00042                                              GET_HANDLE get_handle,
00043                                              IO_HANDLER input_h,
00044                                              CL_HANDLER close_h,
00045                                              SIG_HANDLER sig_h,
00046                                              TO_HANDLER timeout_h,
00047                                              IO_HANDLER output_h,
00048                                              SET_HANDLE set_handle,
00049                                              IO_HANDLER except_h)
00050   : op_handler_ (op_handler),
00051     input_handler_ (input_h),
00052     output_handler_ (output_h),
00053     except_handler_ (except_h),
00054     to_handler_ (timeout_h),
00055     cl_handler_ (close_h),
00056     sig_handler_ (sig_h),
00057     delete_handler_ (delete_handler),
00058     set_handle_ (set_handle),
00059     get_handle_ (get_handle)
00060 {
00061   ACE_TRACE ("ACE_Event_Handler_T<T>::ACE_Event_Handler_T");
00062 }
00063 
00064 template<class T> ACE_HANDLE
00065 ACE_Event_Handler_T<T>::get_handle (void) const
00066 {
00067   ACE_TRACE ("ACE_Event_Handler_T<T>::get_handle");
00068   return this->get_handle_ == 0 ? ACE_INVALID_HANDLE : (this->op_handler_->*get_handle_) ();
00069 }
00070 
00071 template<class T> void
00072 ACE_Event_Handler_T<T>::set_handle (ACE_HANDLE h)
00073 {
00074   ACE_TRACE ("ACE_Event_Handler_T<T>::set_handle");
00075   if (this->set_handle_ != 0)
00076     (this->op_handler_->*set_handle_) (h);
00077 }
00078 
00079 template<class T> int
00080 ACE_Event_Handler_T<T>::handle_input (ACE_HANDLE fd)
00081 {
00082   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_input");
00083   return this->input_handler_ == 0 ? 0 : (this->op_handler_->*input_handler_) (fd);
00084 }
00085 
00086 template<class T> int
00087 ACE_Event_Handler_T<T>::handle_output (ACE_HANDLE fd)
00088 {
00089   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_output");
00090   return this->output_handler_ == 0 ? 0 : (this->op_handler_->*output_handler_) (fd);
00091 }
00092 
00093 template<class T> int
00094 ACE_Event_Handler_T<T>::handle_exception (ACE_HANDLE fd)
00095 {
00096   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_exception");
00097   return this->except_handler_ == 0 ? 0 : (this->op_handler_->*except_handler_) (fd);
00098 }
00099 
00100 template<class T> int
00101 ACE_Event_Handler_T<T>::handle_timeout (const ACE_Time_Value &tv, const void *arg)
00102 {
00103   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_timeout");
00104   return this->to_handler_ == 0 ? 0 : (this->op_handler_->*to_handler_) (tv, arg);
00105 }
00106 
00107 template<class T> int
00108 ACE_Event_Handler_T<T>::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask)
00109 {
00110   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_close");
00111   return this->cl_handler_ == 0 ? 0 : (this->op_handler_->*cl_handler_) (fd, close_mask);
00112 }
00113 
00114 template<class T> int
00115 ACE_Event_Handler_T<T>::handle_signal (int signum, siginfo_t *s, ucontext_t *u)
00116 {
00117   ACE_TRACE ("ACE_Event_Handler_T<T>::handle_signal");
00118   return this->sig_handler_ == 0 ? 0 : (this->op_handler_->*sig_handler_) (signum, s, u);
00119 }
00120 
00121 ACE_END_VERSIONED_NAMESPACE_DECL
00122 
00123 #endif /* ACE_HAS_TEMPLATE_TYPEDEFS */
00124 
00125 #endif /* ACE_EVENT_HANDLER_T_CPP */

Generated on Thu Nov 9 09:41:50 2006 for ACE by doxygen 1.3.6