Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Servant_State.h
blobf1db7dc63095a7eeb3bae7bba95dd1f8ddb6eda3
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_TP_Servant_State.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef TAO_CSD_TP_SERVANT_STATE_H
12 #define TAO_CSD_TP_SERVANT_STATE_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
17 #include "tao/orbconf.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/Intrusive_Ref_Count_Base_T.h"
24 #include "tao/Intrusive_Ref_Count_Handle_T.h"
25 #include "ace/Synch.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 namespace TAO
31 namespace CSD
33 /**
34 * @class TP_Servant_State
36 * @brief Maintains state information for a particular servant.
38 * This TP_Servant_State class is an intrusively reference-counted
39 * class. This allows it to be held in a "smart pointer" (aka, handle)
40 * object that will manage the reference-counting automagically.
42 * One TP_Servant_State object is created for each servant object for
43 * which a request is to be dispatched. The servant state objects are
44 * held (via smart pointers) in a TP_Servant_State_Map object. In turn,
45 * the TP_Servant_State_Map object is a data member of the TP_Stategy
46 * class. Each request placed on to the request queue will hold a
47 * reference (via a smart pointer) to the servant state object.
49 * Currently, the only "state" info held in this TP_Servant_State class
50 * is the servant's busy flag.
53 class TAO_CSD_TP_Export TP_Servant_State
54 : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX>
56 public:
57 /// Handle Type (aka, Smart Pointer Type).
58 typedef TAO_Intrusive_Ref_Count_Handle<TP_Servant_State> HandleType;
60 /// Default Constructor.
61 TP_Servant_State();
63 /// Virtual Destructor.
64 virtual ~TP_Servant_State();
66 /// Accessor for the servant busy flag.
67 bool busy_flag() const;
69 /// Mutator for the servant busy flag.
70 void busy_flag(bool new_value);
72 private:
73 /// The servant's current "busy" state (true == busy, false == not busy)
74 bool busy_flag_;
79 TAO_END_VERSIONED_NAMESPACE_DECL
81 #if defined (__ACE_INLINE__)
82 # include "tao/CSD_ThreadPool/CSD_TP_Servant_State.inl"
83 #endif /* __ACE_INLINE__ */
85 #include /**/ "ace/post.h"
87 #endif /* TAO_CSD_TP_SERVANT_STATE_H */