Updated logging to include the class/method so that it is more obvious where these...
[ACE_TAO.git] / TAO / tao / LF_Multi_Event.h
blobbb8497e3df106bba55f7c709bbaee0333c7734a4
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 (void);
43 /// Destructor
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
56 /// to be returned.
57 TAO_Connection_Handler *winner(void);
59 /// Returns the transport associated with the first entry in the collection.
60 TAO_Transport *base_transport(void);
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:
85 struct Event_Node {
86 TAO_Connection_Handler * ptr_;
87 Event_Node *next_;
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 */