2 #include "ace/Reactor.h"
4 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
6 ACE_INLINE ACE_Select_Reactor_Handler_Repository::size_type
7 ACE_Select_Reactor_Handler_Repository::size () const
9 #ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP
10 return this->event_handlers_.total_size ();
12 return this->event_handlers_.size ();
13 #endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */
16 ACE_INLINE ACE_Select_Reactor_Handler_Repository::max_handlep1_type
17 ACE_Select_Reactor_Handler_Repository::max_handlep1 () const
19 #ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP
20 return this->event_handlers_.current_size ();
22 return this->max_handlep1_;
23 #endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */
27 ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle,
28 ACE_Reactor_Mask mask)
30 // Do not refactor this code to optimize the call to the unbind impl.
31 // To resolve bug 2653, unbind must be called even when find_eh returns
32 // event_handlers_.end().
34 return !this->handle_in_range (handle) ? -1
35 : this->unbind (handle,
36 this->find_eh (handle),
40 ACE_INLINE ACE_Event_Handler *
41 ACE_Select_Reactor_Handler_Repository::find (ACE_HANDLE handle)
43 ACE_TRACE ("ACE_Select_Reactor_Handler_Repository::find");
45 ACE_Event_Handler * eh = 0;
47 if (this->handle_in_range (handle))
49 map_type::iterator const pos = this->find_eh (handle);
51 if (pos != this->event_handlers_.end ())
53 #ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP
57 #endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */
60 // Don't bother setting errno. It isn't used in the select()-based
61 // reactors and incurs a TSS access.
70 // ------------------------------------------------------------------
73 ACE_Select_Reactor_Handler_Repository_Iterator::done () const
75 #ifdef ACE_SELECT_REACTOR_BASE_USES_HASH_MAP
76 return this->current_ == this->rep_->event_handlers_.end ();
78 return this->current_ == (this->rep_->event_handlers_.begin ()
79 + this->rep_->max_handlep1 ());
80 #endif /* ACE_SELECT_REACTOR_BASE_USES_HASH_MAP */
83 // ------------------------------------------------------------------
86 ACE_Event_Tuple::ACE_Event_Tuple ()
87 : handle_ (ACE_INVALID_HANDLE),
93 ACE_Event_Tuple::ACE_Event_Tuple (ACE_Event_Handler* eh,
101 ACE_Event_Tuple::operator== (const ACE_Event_Tuple &rhs) const
103 return this->handle_ == rhs.handle_;
107 ACE_Event_Tuple::operator!= (const ACE_Event_Tuple &rhs) const
109 return !(*this == rhs);
112 #if defined (_MSC_VER)
113 # pragma warning (push)
114 # pragma warning (disable:4355) /* Use of 'this' in initializer list */
117 ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms)
118 : handler_rep_ (*this)
120 , signal_handler_ (0)
121 , notify_handler_ (0)
122 , delete_timer_queue_ (false)
123 , delete_signal_handler_ (false)
124 , delete_notify_handler_ (false)
125 , initialized_ (false)
127 , requeue_position_ (-1) // Requeue at end of waiters by default.
128 , owner_ (ACE_OS::NULL_thread)
129 , state_changed_ (false)
134 #if defined (_MSC_VER)
135 # pragma warning (pop)
139 ACE_Select_Reactor_Impl::supress_notify_renew ()
141 return this->supress_renew_;
145 ACE_Select_Reactor_Impl::supress_notify_renew (bool sr)
147 this->supress_renew_ = sr;
150 ACE_END_VERSIONED_NAMESPACE_DECL