Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / LF_Multi_Event.h
blobfa9f836d548ce703f2edcba18edb98fc98f9e7d3
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file LF_Multi_Event.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
8 */
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)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
24 // Forward decls
25 class TAO_Connection_Handler;
26 class TAO_Transport;
28 /**
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
35 * connections.
37 class TAO_Export TAO_LF_Multi_Event: public TAO_LF_Event
39 public:
40 /// Constructor
41 TAO_LF_Multi_Event ();
43 /// Destructor
44 virtual ~TAO_LF_Multi_Event ();
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
56 /// to be returned.
57 TAO_Connection_Handler *winner();
59 /// Returns the transport associated with the first entry in the collection.
60 TAO_Transport *base_transport();
62 private:
63 void operator= (const TAO_LF_Multi_Event &);
64 TAO_LF_Multi_Event (const TAO_LF_Multi_Event &);
66 protected:
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;
83 private:
84 struct Event_Node {
85 TAO_Connection_Handler * ptr_;
86 Event_Node *next_;
89 struct Event_Node *events_;
91 mutable TAO_Connection_Handler * winner_;
94 TAO_END_VERSIONED_NAMESPACE_DECL
96 #include /**/ "ace/post.h"
98 #endif /* TAO_LF_Multi_EVENT_H */