diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-01 23:39:57 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-01 23:39:57 +0000 |
commit | 28f2b1eecfab765469d97d38b686bffdea53114c (patch) | |
tree | e11d110b2f6e69f07a780756276cc735be3e8fa9 /TAO/tao/LF_Event_Loop_Thread_Helper.h | |
parent | 545c5cb11c374d0333e7d0f1c88f12694ad2eaee (diff) | |
download | ATCD-28f2b1eecfab765469d97d38b686bffdea53114c.tar.gz |
ChangeLogTag:Wed Aug 1 16:05:36 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/LF_Event_Loop_Thread_Helper.h')
-rw-r--r-- | TAO/tao/LF_Event_Loop_Thread_Helper.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.h b/TAO/tao/LF_Event_Loop_Thread_Helper.h new file mode 100644 index 00000000000..5edde3028b1 --- /dev/null +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.h @@ -0,0 +1,62 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Event_Loop_Thread_Helper.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_EVENT_LOOP_THREAD_HELPER_H +#define TAO_LF_EVENT_LOOP_THREAD_HELPER_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/LF_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @brief Helper class to enter and exit the Leader/Followers event + * loop. + * + * Uses the Guard idiom to enter and exit the Leader/Followers event + * loop. + */ +class TAO_Export TAO_LF_Event_Loop_Thread_Helper +{ +public: + /// Constructor + TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower, + TAO_LF_Strategy &lf_strategy, + ACE_Time_Value *max_wait_time); + + /// Destructor + ~TAO_LF_Event_Loop_Thread_Helper (void); + + /// Calls <set_event_loop_thread> on the leader/followers object. + int event_loop_return (void) const; + +private: + /// Reference to leader/followers object. + TAO_Leader_Follower &leader_follower_; + + /// The Leader/Follower Strategy used by this ORB. + TAO_LF_Strategy &lf_strategy_; + + /// Remembers the status returned while trying to enter the event + /// loop. + int event_loop_return_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Event_Loop_Thread_Helper.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_EVENT_LOOP_THREAD_HELPER_H */ |