3 //=============================================================================
5 * @file LF_Multi_Event.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_LF_MULTI_EVENT_H
12 #define TAO_LF_MULTI_EVENT_H
14 #include /**/ "ace/pre.h"
16 #include "tao/LF_Event.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
25 class TAO_Connection_Handler
;
29 * @class TAO_LF_Multi_Event
31 * @brief Use the Leader/Follower loop to wait for one specific event
32 * in the invocation path.
34 * Used by the parallel connection strategy for waiting on one of many
37 class TAO_Export TAO_LF_Multi_Event
: public TAO_LF_Event
41 TAO_LF_Multi_Event (void);
44 virtual ~TAO_LF_Multi_Event (void);
46 /// Propagate the follower to all the events in the collection.
47 virtual int bind (TAO_LF_Follower
*follower
);
49 /// Unbind the follower from all the collected events.
50 virtual int unbind (TAO_LF_Follower
*follower
);
52 /// Adds a handler to the collection
53 void add_event (TAO_Connection_Handler
*ch
);
55 /// Returns the connection handler that caused the successful status
57 TAO_Connection_Handler
*winner(void);
59 /// Returns the transport associated with the first entry in the collection.
60 TAO_Transport
*base_transport(void);
63 void operator= (const TAO_LF_Multi_Event
&);
64 TAO_LF_Multi_Event (const TAO_LF_Multi_Event
&);
67 /// Validate the state change
68 virtual void state_changed_i (LFS_STATE new_state
);
70 /// Check whether we have reached the final state..
71 virtual bool is_state_final () const;
73 /// Return true if the condition was satisfied successfully, false if it
74 /// has not - This iterates over the list of attached events and
75 /// returns true if any of them return true from successful.
76 virtual bool successful_i () const;
78 /// Return true if an error was detected while waiting for the
79 /// event - This iterates over the list of events and returns
80 /// true only if all of them return true from error_detected().
81 virtual bool error_detected_i () const;
86 TAO_Connection_Handler
* ptr_
;
90 struct Event_Node
*events_
;
92 mutable TAO_Connection_Handler
* winner_
;
95 TAO_END_VERSIONED_NAMESPACE_DECL
97 #include /**/ "ace/post.h"
99 #endif /* TAO_LF_Multi_EVENT_H */