00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file LF_Invocation_Event.h 00006 * 00007 * $Id: LF_Invocation_Event.h 71473 2006-03-10 07:19:20Z jtc $ 00008 * 00009 * @author Carlos O'Ryan <coryan@uci.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_LF_INVOCATION_EVENT_H 00014 #define TAO_LF_INVOCATION_EVENT_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/LF_Event.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class TAO_LF_Invocation_Event 00028 * 00029 * @brief Use the Leader/Follower loop to wait for one specific event 00030 * in the invocation path. 00031 * 00032 * Concrete event types and manipulation class through which the 00033 * invocation data path would flow. Typically state changes of 00034 * interest include whether a message has arrived, or timedout waiting 00035 * for a message or if the cionnection is closed waiting for a 00036 * message. Details of the states are documented within the class. 00037 * 00038 */ 00039 class TAO_Export TAO_LF_Invocation_Event: public TAO_LF_Event 00040 { 00041 public: 00042 /// Constructor 00043 TAO_LF_Invocation_Event (void); 00044 00045 /// Destructor 00046 virtual ~TAO_LF_Invocation_Event (void); 00047 00048 /// Return 1 if the condition was satisfied successfully, 0 if it 00049 /// has not 00050 int successful (void) const; 00051 00052 /// Return 1 if an error was detected while waiting for the 00053 /// event 00054 int error_detected (void) const; 00055 //@} 00056 00057 protected: 00058 00059 /// Validate and perform the state change 00060 /* 00061 * This concrete class uses the following states declared in the 00062 * class TAO_LF_Event 00063 * 00064 * LFS_IDLE - The event is created, and is in initial state. 00065 * LFS_ACTIVE - The event is active and it can transition to any of 00066 * the following states, all the states are final. 00067 * LFS_SUCCESS - The event has completed successfully. 00068 * LFS_FAILURE - A failure has been detected while the event was 00069 * active. 00070 * LFS_TIMEOUT - The event has timed out. 00071 * LFS_CONNECTION_CLOSED - The connection was closed when the state 00072 * was active. 00073 * 00074 */ 00075 virtual void state_changed_i (int new_state); 00076 00077 private: 00078 /// Check whether we have reached the final state.. 00079 int is_state_final (void); 00080 }; 00081 00082 TAO_END_VERSIONED_NAMESPACE_DECL 00083 00084 #include /**/ "ace/post.h" 00085 00086 #endif /* TAO_LF_INVOCATION_EVENT_H */