[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / Select_Reactor_Base.inl
blobd91492b3734c59d116cb13128868d1c25ef62ba2
1 // -*- C++ -*-
2 //
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
12 #ifdef ACE_WIN32
13   return this->event_handlers_.total_size ();
14 #else
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
22 #ifdef ACE_WIN32
23   return this->event_handlers_.current_size ();
24 #else
25   return this->max_handlep1_;
26 #endif  /* ACE_WIN32 */
29 ACE_INLINE int
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),
40                           mask);
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))
51     {
52       map_type::iterator const pos = this->find_eh (handle);
54       if (pos != this->event_handlers_.end ())
55         {
56 #ifdef ACE_WIN32
57           eh = (*pos).item ();
58 #else
59           eh = *pos;
60 #endif  /* ACE_WIN32 */
61         }
62     }
63   // Don't bother setting errno.  It isn't used in the select()-based
64   // reactors and incurs a TSS access.
65   //   else
66   //     {
67   //       errno = ENOENT;
68   //     }
70   return eh;
73 // ------------------------------------------------------------------
75 ACE_INLINE bool
76 ACE_Select_Reactor_Handler_Repository_Iterator::done (void) const
78 #ifdef ACE_WIN32
79   return this->current_ == this->rep_->event_handlers_.end ();
80 #else
81   return this->current_ == (this->rep_->event_handlers_.begin ()
82                             + this->rep_->max_handlep1 ());
83 #endif /* ACE_WIN32 */
86 // ------------------------------------------------------------------
88 ACE_INLINE
89 ACE_Event_Tuple::ACE_Event_Tuple (void)
90   : handle_ (ACE_INVALID_HANDLE),
91     event_handler_ (0)
95 ACE_INLINE
96 ACE_Event_Tuple::ACE_Event_Tuple (ACE_Event_Handler* eh,
97                                   ACE_HANDLE h)
98   : handle_ (h),
99     event_handler_ (eh)
103 ACE_INLINE bool
104 ACE_Event_Tuple::operator== (const ACE_Event_Tuple &rhs) const
106   return this->handle_ == rhs.handle_;
109 ACE_INLINE bool
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 */
118 #endif
119 ACE_INLINE
120 ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms)
121   : handler_rep_ (*this)
122   , timer_queue_ (0)
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)
129   , restart_ (0)
130   , requeue_position_ (-1) // Requeue at end of waiters by default.
131   , state_changed_ (0)
132   , mask_signals_ (ms)
133   , supress_renew_ (0)
136 #if defined (ACE_WIN32_VC8) || defined (ACE_WIN32_VC9)
137 #  pragma warning (pop)
138 #endif
140 ACE_INLINE int
141 ACE_Select_Reactor_Impl::supress_notify_renew (void)
143   return this->supress_renew_;
146 ACE_INLINE void
147 ACE_Select_Reactor_Impl::supress_notify_renew (int sr)
149   this->supress_renew_ = sr;
152 ACE_END_VERSIONED_NAMESPACE_DECL