00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CSD_TP_Servant_State.h 00006 * 00007 * $Id: CSD_TP_Servant_State.h 80158 2007-12-02 16:12:30Z sowayaa $ 00008 * 00009 * @author Tim Bradley <bradley_t@ociweb.com> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_CSD_TP_SERVANT_STATE_H 00014 #define TAO_CSD_TP_SERVANT_STATE_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/CSD_ThreadPool/CSD_TP_Export.h" 00019 #include "tao/orbconf.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/Intrusive_Ref_Count_Base_T.h" 00026 #include "tao/Intrusive_Ref_Count_Handle_T.h" 00027 #include "ace/Synch.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace TAO 00032 { 00033 namespace CSD 00034 { 00035 00036 /** 00037 * @class TP_Servant_State 00038 * 00039 * @brief Maintains state information for a particular servant. 00040 * 00041 * This TP_Servant_State class is an intrusively reference-counted 00042 * class. This allows it to be held in a "smart pointer" (aka, handle) 00043 * object that will manage the reference-counting automagically. 00044 * 00045 * One TP_Servant_State object is created for each servant object for 00046 * which a request is to be dispatched. The servant state objects are 00047 * held (via smart pointers) in a TP_Servant_State_Map object. In turn, 00048 * the TP_Servant_State_Map object is a data member of the TP_Stategy 00049 * class. Each request placed on to the request queue will hold a 00050 * reference (via a smart pointer) to the servant state object. 00051 * 00052 * Currently, the only "state" info held in this TP_Servant_State class 00053 * is the servant's busy flag. 00054 * 00055 */ 00056 class TAO_CSD_TP_Export TP_Servant_State 00057 : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> 00058 { 00059 public: 00060 00061 /// Handle Type (aka, Smart Pointer Type). 00062 typedef TAO_Intrusive_Ref_Count_Handle<TP_Servant_State> HandleType; 00063 00064 /// Default Constructor. 00065 TP_Servant_State(); 00066 00067 /// Virtual Destructor. 00068 virtual ~TP_Servant_State(); 00069 00070 /// Accessor for the servant busy flag. 00071 bool busy_flag() const; 00072 00073 /// Mutator for the servant busy flag. 00074 void busy_flag(bool new_value); 00075 00076 private: 00077 00078 /// The servant's current "busy" state (true == busy, false == not busy) 00079 bool busy_flag_; 00080 }; 00081 00082 } 00083 } 00084 00085 TAO_END_VERSIONED_NAMESPACE_DECL 00086 00087 #if defined (__ACE_INLINE__) 00088 # include "tao/CSD_ThreadPool/CSD_TP_Servant_State.inl" 00089 #endif /* __ACE_INLINE__ */ 00090 00091 #include /**/ "ace/post.h" 00092 00093 #endif /* TAO_CSD_TP_SERVANT_STATE_H */