summaryrefslogtreecommitdiff
path: root/TAO/tao/LF_Multi_Event.h
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
commit3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (patch)
tree197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tao/LF_Multi_Event.h
parent6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (diff)
downloadATCD-3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/tao/LF_Multi_Event.h')
-rw-r--r--TAO/tao/LF_Multi_Event.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/TAO/tao/LF_Multi_Event.h b/TAO/tao/LF_Multi_Event.h
new file mode 100644
index 00000000000..5d2167db55b
--- /dev/null
+++ b/TAO/tao/LF_Multi_Event.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LF_Multi_Event.h
+ *
+ * $Id$
+ *
+ * @author Phil Mesnier <mesnier_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_LF_MULTI_EVENT_H
+#define TAO_LF_MULTI_EVENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/LF_Event.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decls
+class TAO_Connection_Handler;
+class TAO_Transport;
+
+/**
+ * @class TAO_LF_Multi_Event
+ *
+ * @brief Use the Leader/Follower loop to wait for one specific event
+ * in the invocation path.
+ *
+ * Used by the parallel connection strategy for waiting on one of many
+ * connections.
+ */
+class TAO_Export TAO_LF_Multi_Event: public TAO_LF_Event
+{
+public:
+ /// Constructor
+ TAO_LF_Multi_Event (void);
+
+ /// Destructor
+ virtual ~TAO_LF_Multi_Event (void);
+
+ /// propogate the follower to all the events in the collection.
+ virtual int bind (TAO_LF_Follower *follower);
+
+ /// Unbind the follower from all the collected events.
+ virtual int unbind (void);
+
+ /// Adds a handler to the collection
+ void add_event (TAO_Connection_Handler *ch);
+
+ /// Returns the connection handler that caused the successful status
+ /// to be returned.
+ TAO_Connection_Handler *winner(void);
+
+ /// Returns the transport associated with the first entry in the collection.
+ TAO_Transport *base_transport(void);
+
+ //@{
+ /// Return 1 if the condition was satisfied successfully, 0 if it
+ /// has not - This iterates over the list of attached events and
+ /// returns 1 if any of them return 1 from successful.
+ int successful (void) const;
+
+ /// Return 1 if an error was detected while waiting for the
+ /// event - This iterates over the list of events and returns
+ /// 1 only if all of them return 1 from error_detected.
+ int error_detected (void) const;
+
+ //@}
+protected:
+
+ /// Validate the state change
+ virtual void state_changed_i (int new_state);
+
+ /// Check whether we have reached the final state..
+ virtual int is_state_final (void);
+
+private:
+
+ struct Event_Node {
+ TAO_Connection_Handler * ptr_;
+ Event_Node *next_;
+ };
+
+ struct Event_Node *events_;
+
+ mutable TAO_Connection_Handler * winner_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LF_Multi_EVENT_H */