1 #include "tao/LF_Multi_Event.h"
2 #include "tao/Connection_Handler.h"
3 #include "ace/OS_Memory.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
8 TAO_LF_Multi_Event::TAO_LF_Multi_Event ()
15 TAO_LF_Multi_Event::~TAO_LF_Multi_Event ()
17 while (this->events_
!= nullptr)
19 Event_Node
*n
= this->events_
->next_
;
26 TAO_LF_Multi_Event::bind (TAO_LF_Follower
*follower
)
28 if (this->TAO_LF_Event::bind(follower
) == -1)
33 for (Event_Node
*n
= this->events_
; n
!= nullptr; n
= n
->next_
)
34 if (n
->ptr_
->bind(follower
) == -1)
42 TAO_LF_Multi_Event::unbind (TAO_LF_Follower
*follower
)
44 if (this->TAO_LF_Event::unbind (follower
) == -1)
49 for (Event_Node
*n
= this->events_
; n
!= nullptr; n
= n
->next_
)
50 if (n
->ptr_
->unbind (follower
) == -1)
59 TAO_LF_Multi_Event::add_event (TAO_Connection_Handler
*ev
)
61 Event_Node
*node
= nullptr;
62 ACE_NEW (node
, Event_Node
);
63 node
->next_
= this->events_
;
69 TAO_Connection_Handler
*
70 TAO_LF_Multi_Event::winner ()
76 TAO_LF_Multi_Event::base_transport ()
78 return (this->events_
== nullptr) ? nullptr : this->events_
->ptr_
->transport();
82 TAO_LF_Multi_Event::successful_i () const
84 for (Event_Node
*n
= this->events_
; n
!= nullptr; n
= n
->next_
)
85 if (n
->ptr_
->successful_i())
87 this->winner_
= n
->ptr_
;
94 TAO_LF_Multi_Event::error_detected_i () const
96 for (Event_Node
*n
= this->events_
; n
!= nullptr; n
= n
->next_
)
98 if (!n
->ptr_
->error_detected_i ())
107 TAO_LF_Multi_Event::state_changed_i (LFS_STATE
)
112 TAO_LF_Multi_Event::is_state_final () const
114 for (Event_Node
*n
= this->events_
; n
!= nullptr; n
= n
->next_
)
116 if (!n
->ptr_
->is_state_final ())
124 TAO_END_VERSIONED_NAMESPACE_DECL