3 // $Id: Select_Reactor_Base.inl 81138 2008-03-28 09:18:15Z johnnyw $
5 #include "ace/Reactor.h"
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 ACE_INLINE ACE_Select_Reactor_Handler_Repository::size_type
10 ACE_Select_Reactor_Handler_Repository::size (void) const
13 return this->event_handlers_.total_size ();
15 return this->event_handlers_.size ();
16 #endif /* ACE_WIN32 */
19 ACE_INLINE ACE_Select_Reactor_Handler_Repository::max_handlep1_type
20 ACE_Select_Reactor_Handler_Repository::max_handlep1 (void) const
23 return this->event_handlers_.current_size ();
25 return this->max_handlep1_;
26 #endif /* ACE_WIN32 */
30 ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle,
31 ACE_Reactor_Mask mask)
33 // Do not refactor this code to optimize the call to the unbind impl.
34 // To resolve bug 2653, unbind must be called even when find_eh returns
35 // event_handlers_.end().
37 return !this->handle_in_range (handle) ? -1
38 : this->unbind (handle,
39 this->find_eh (handle),
43 ACE_INLINE ACE_Event_Handler *
44 ACE_Select_Reactor_Handler_Repository::find (ACE_HANDLE handle)
46 ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::find");
48 ACE_Event_Handler * eh = 0;
50 if (this->handle_in_range (handle))
52 map_type::iterator const pos = this->find_eh (handle);
54 if (pos != this->event_handlers_.end ())
60 #endif /* ACE_WIN32 */
63 // Don't bother setting errno. It isn't used in the select()-based
64 // reactors and incurs a TSS access.
73 // ------------------------------------------------------------------
76 ACE_Select_Reactor_Handler_Repository_Iterator::done (void) const
79 return this->current_ == this->rep_->event_handlers_.end ();
81 return this->current_ == (this->rep_->event_handlers_.begin ()
82 + this->rep_->max_handlep1 ());
83 #endif /* ACE_WIN32 */
86 // ------------------------------------------------------------------
89 ACE_Event_Tuple::ACE_Event_Tuple (void)
90 : handle_ (ACE_INVALID_HANDLE),
96 ACE_Event_Tuple::ACE_Event_Tuple (ACE_Event_Handler* eh,
104 ACE_Event_Tuple::operator== (const ACE_Event_Tuple &rhs) const
106 return this->handle_ == rhs.handle_;
110 ACE_Event_Tuple::operator!= (const ACE_Event_Tuple &rhs) const
112 return !(*this == rhs);
115 #if defined (ACE_WIN32_VC8) || defined (ACE_WIN32_VC9)
116 # pragma warning (push)
117 # pragma warning (disable:4355) /* Use of 'this' in initializer list */
120 ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms)
121 : handler_rep_ (*this)
123 , signal_handler_ (0)
124 , notify_handler_ (0)
125 , delete_timer_queue_ (false)
126 , delete_signal_handler_ (false)
127 , delete_notify_handler_ (false)
128 , initialized_ (false)
130 , requeue_position_ (-1) // Requeue at end of waiters by default.
136 #if defined (ACE_WIN32_VC8) || defined (ACE_WIN32_VC9)
137 # pragma warning (pop)
141 ACE_Select_Reactor_Impl::supress_notify_renew (void)
143 return this->supress_renew_;
147 ACE_Select_Reactor_Impl::supress_notify_renew (int sr)
149 this->supress_renew_ = sr;
152 ACE_END_VERSIONED_NAMESPACE_DECL