Revert to Current Include Style
[ACE_TAO.git] / ACE / ace / TP_Reactor.inl
blobf793fd23c6e7524d9d8e60c0d489eb152632f516
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 /************************************************************************/
5 // Methods for ACE_EH_Dispatch_Info
6 /************************************************************************/
8 ACE_INLINE
9 ACE_EH_Dispatch_Info::ACE_EH_Dispatch_Info (void) :
10   handle_ (ACE_INVALID_HANDLE),
11   event_handler_ (0),
12   mask_ (ACE_Event_Handler::NULL_MASK),
13   callback_ (0),
14   resume_flag_ (ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER),
15   reference_counting_required_ (false),
16   dispatch_ (false)
20 ACE_INLINE void
21 ACE_EH_Dispatch_Info::set (ACE_HANDLE handle,
22                            ACE_Event_Handler *event_handler,
23                            ACE_Reactor_Mask mask,
24                            ACE_EH_PTMF callback)
26   this->dispatch_ = true;
28   this->handle_ = handle;
29   this->event_handler_ = event_handler;
30   this->mask_ = mask;
31   this->callback_ = callback;
32   if (event_handler_)
33     {
34       this->resume_flag_ = event_handler->resume_handler ();
35       this->reference_counting_required_ =
36         (event_handler_->reference_counting_policy ().value () ==
37          ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
38     }
39   else
40     this->dispatch_ = false;
43 ACE_INLINE bool
44 ACE_EH_Dispatch_Info::dispatch (void) const
46   return this->dispatch_;
49 /************************************************************************/
50 // Methods for ACE_TP_Token_Guard
51 /************************************************************************/
53 ACE_INLINE
54 ACE_TP_Token_Guard::ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token)
56   : token_ (token),
57     owner_ (false)
61 ACE_INLINE
62 ACE_TP_Token_Guard::~ACE_TP_Token_Guard (void)
64   if (this->owner_)
65     {
66       ACE_MT (this->token_.release ());
67       this->owner_ = false;
68     }
71 ACE_INLINE void
72 ACE_TP_Token_Guard::release_token (void)
74   if (this->owner_)
75     {
76       ACE_MT (this->token_.release ());
78       // We are not the owner anymore..
79       this->owner_ = false;
80     }
83 ACE_INLINE bool
84 ACE_TP_Token_Guard::is_owner (void)
86   return this->owner_;
90 /************************************************************************/
91 // Methods for ACE_TP_Reactor
92 /************************************************************************/
94 ACE_INLINE void
95 ACE_TP_Reactor::no_op_sleep_hook (void *)
99 ACE_INLINE void
100 ACE_TP_Reactor::clear_handle_read_set (ACE_HANDLE handle)
102   this->ready_set_.wr_mask_.clr_bit (handle);
103   this->ready_set_.ex_mask_.clr_bit (handle);
104   this->ready_set_.rd_mask_.clr_bit (handle);
107 ACE_INLINE void
108 ACE_TP_Reactor::clear_dispatch_mask (ACE_HANDLE ,
109                                      ACE_Reactor_Mask )
111   this->ready_set_.rd_mask_.reset ();
112   this->ready_set_.wr_mask_.reset ();
113   this->ready_set_.ex_mask_.reset ();
116 ACE_END_VERSIONED_NAMESPACE_DECL