TP_Reactor.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // TP_Reactor.inl,v 4.4 2006/03/17 08:48:27 jwillemsen Exp
00004 
00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 /************************************************************************/
00008 // Methods for ACE_EH_Dispatch_Info
00009 /************************************************************************/
00010 
00011 ACE_INLINE
00012 ACE_EH_Dispatch_Info::ACE_EH_Dispatch_Info (void) :
00013   handle_ (ACE_INVALID_HANDLE),
00014   event_handler_ (0),
00015   mask_ (ACE_Event_Handler::NULL_MASK),
00016   callback_ (0),
00017   resume_flag_ (ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER),
00018   reference_counting_required_ (false),
00019   dispatch_ (false)
00020 {
00021 }
00022 
00023 ACE_INLINE void
00024 ACE_EH_Dispatch_Info::set (ACE_HANDLE handle,
00025                            ACE_Event_Handler *event_handler,
00026                            ACE_Reactor_Mask mask,
00027                            ACE_EH_PTMF callback)
00028 {
00029   this->dispatch_ = true;
00030 
00031   this->handle_ = handle;
00032   this->event_handler_ = event_handler;
00033   this->mask_ = mask;
00034   this->callback_ = callback;
00035   this->resume_flag_ = event_handler->resume_handler ();
00036   this->reference_counting_required_ =
00037     (event_handler_->reference_counting_policy ().value () ==
00038       ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
00039 }
00040 
00041 ACE_INLINE bool
00042 ACE_EH_Dispatch_Info::dispatch (void) const
00043 {
00044   return this->dispatch_;
00045 }
00046 
00047 /************************************************************************/
00048 // Methods for ACE_TP_Token_Guard
00049 /************************************************************************/
00050 
00051 ACE_INLINE
00052 ACE_TP_Token_Guard::ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token)
00053 
00054   : token_ (token),
00055     owner_ (0)
00056 {
00057 }
00058 
00059 ACE_INLINE
00060 ACE_TP_Token_Guard::~ACE_TP_Token_Guard (void)
00061 {
00062   if (this->owner_ == 1)
00063     {
00064       ACE_MT (this->token_.release ());
00065       this->owner_ = 0;
00066     }
00067 }
00068 
00069 ACE_INLINE void
00070 ACE_TP_Token_Guard::release_token (void)
00071 {
00072   if (this->owner_)
00073     {
00074       ACE_MT (this->token_.release ());
00075 
00076       // We are not the owner anymore..
00077       this->owner_ = 0;
00078     }
00079 }
00080 
00081 ACE_INLINE int
00082 ACE_TP_Token_Guard::is_owner (void)
00083 {
00084   return this->owner_;
00085 }
00086 
00087 
00088 /************************************************************************/
00089 // Methods for ACE_TP_Reactor
00090 /************************************************************************/
00091 
00092 ACE_INLINE void
00093 ACE_TP_Reactor::no_op_sleep_hook (void *)
00094 {
00095 }
00096 
00097 ACE_INLINE void
00098 ACE_TP_Reactor::clear_handle_read_set (ACE_HANDLE handle)
00099 {
00100   this->ready_set_.wr_mask_.clr_bit (handle);
00101   this->ready_set_.ex_mask_.clr_bit (handle);
00102   this->ready_set_.rd_mask_.clr_bit (handle);
00103 }
00104 
00105 ACE_INLINE void
00106 ACE_TP_Reactor::clear_dispatch_mask (ACE_HANDLE ,
00107                                      ACE_Reactor_Mask )
00108 {
00109   this->ready_set_.rd_mask_.reset ();
00110   this->ready_set_.wr_mask_.reset ();
00111   this->ready_set_.ex_mask_.reset ();
00112 }
00113 
00114 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:42:08 2006 for ACE by doxygen 1.3.6