Go to the documentation of this file.00001
00002
00003
00004 #include "ace/Log_Msg.h"
00005
00006 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00007
00008 ACE_INLINE
00009 ACE_Dev_Poll_Reactor::Event_Tuple::Event_Tuple (ACE_Event_Handler *eh,
00010 ACE_Reactor_Mask m,
00011 bool is_suspended,
00012 bool is_controlled)
00013 : event_handler (eh),
00014 mask (m),
00015 suspended (is_suspended),
00016 controlled (is_controlled)
00017 {
00018 }
00019
00020
00021
00022 ACE_INLINE size_t
00023 ACE_Dev_Poll_Reactor::Handler_Repository::size (void) const
00024 {
00025 ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::size");
00026
00027 return this->size_;
00028 }
00029
00030 ACE_INLINE size_t
00031 ACE_Dev_Poll_Reactor::Handler_Repository::max_size (void) const
00032 {
00033 ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::max_size");
00034
00035 return this->max_size_;
00036 }
00037
00038
00039
00040 ACE_INLINE
00041 ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard
00042 (ACE_Event_Handler *eh,
00043 bool do_incr)
00044 : eh_ (eh),
00045 refcounted_ (false)
00046 {
00047 if (eh == 0)
00048 return;
00049
00050 this->refcounted_ =
00051 eh->reference_counting_policy ().value () ==
00052 ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
00053
00054 if (do_incr && this->refcounted_)
00055 eh->add_reference ();
00056 }
00057
00058 ACE_INLINE
00059 ACE_Dev_Poll_Handler_Guard::~ACE_Dev_Poll_Handler_Guard (void)
00060 {
00061 if (this->refcounted_ && this->eh_ != 0)
00062 this->eh_->remove_reference ();
00063 }
00064
00065 ACE_INLINE void
00066 ACE_Dev_Poll_Handler_Guard::release (void)
00067 {
00068 this->eh_ = 0;
00069 }
00070
00071
00072
00073 ACE_INLINE int
00074 ACE_Dev_Poll_Reactor::upcall (ACE_Event_Handler *event_handler,
00075 int (ACE_Event_Handler::*callback)(ACE_HANDLE),
00076 ACE_HANDLE handle)
00077 {
00078
00079
00080
00081
00082 int status = 0;
00083
00084 do
00085 {
00086 status = (event_handler->*callback) (handle);
00087 }
00088 while (status > 0 && event_handler != this->notify_handler_);
00089
00090 return status;
00091 }
00092
00093
00094
00095
00096
00097
00098 ACE_INLINE
00099 ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token)
00100
00101 : token_ (token),
00102 owner_ (0)
00103 {
00104 }
00105
00106 ACE_INLINE
00107 ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void)
00108 {
00109 if (this->owner_ == 1)
00110 {
00111 ACE_MT (this->token_.release ());
00112 this->owner_ = 0;
00113 }
00114 }
00115
00116 ACE_INLINE void
00117 ACE_Dev_Poll_Reactor::Token_Guard::release_token (void)
00118 {
00119 if (this->owner_)
00120 {
00121 ACE_MT (this->token_.release ());
00122
00123
00124 this->owner_ = 0;
00125 }
00126 }
00127
00128 ACE_INLINE int
00129 ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void)
00130 {
00131 return this->owner_;
00132 }
00133
00134 ACE_END_VERSIONED_NAMESPACE_DECL