LF_Event_Loop_Thread_Helper.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file LF_Event_Loop_Thread_Helper.h
00006  *
00007  *  LF_Event_Loop_Thread_Helper.h,v 1.6 2005/11/02 07:13:03 ossama Exp
00008  *
00009  *  @author Carlos O'Ryan <coryan@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_LF_EVENT_LOOP_THREAD_HELPER_H
00014 #define TAO_LF_EVENT_LOOP_THREAD_HELPER_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/LF_Strategy.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  * @brief Helper class to enter and exit the Leader/Followers event
00028  * loop.
00029  *
00030  * Uses the Guard idiom to enter and exit the Leader/Followers event
00031  * loop.
00032  */
00033 class TAO_Export TAO_LF_Event_Loop_Thread_Helper
00034 {
00035 public:
00036   /// Constructor
00037   TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower,
00038                                    TAO_LF_Strategy &lf_strategy,
00039                                    ACE_Time_Value *max_wait_time);
00040 
00041   /// Destructor
00042   ~TAO_LF_Event_Loop_Thread_Helper (void);
00043 
00044   /// Calls <set_event_loop_thread> on the leader/followers object.
00045   int event_loop_return (void) const;
00046 
00047 private:
00048   /// Reference to leader/followers object.
00049   TAO_Leader_Follower &leader_follower_;
00050 
00051   /// The Leader/Follower Strategy used by this ORB.
00052   TAO_LF_Strategy &lf_strategy_;
00053 
00054   /// Remembers the status returned while trying to enter the event
00055   /// loop.
00056   int event_loop_return_;
00057 };
00058 
00059 TAO_END_VERSIONED_NAMESPACE_DECL
00060 
00061 #if defined (__ACE_INLINE__)
00062 # include "tao/LF_Event_Loop_Thread_Helper.inl"
00063 #endif /* __ACE_INLINE__ */
00064 
00065 #include /**/ "ace/post.h"
00066 
00067 #endif  /* TAO_LF_EVENT_LOOP_THREAD_HELPER_H */

Generated on Thu Nov 9 11:54:15 2006 for TAO by doxygen 1.3.6