3 //=============================================================================
5 * @file CSD_TP_Servant_State_Map.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_CSD_TP_SERVANT_STATE_MAP_H
12 #define TAO_CSD_TP_SERVANT_STATE_MAP_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/CSD_ThreadPool/CSD_TP_Servant_State.h"
23 #include "tao/PortableServer/PortableServer.h"
24 #include "ace/Hash_Map_Manager.h"
25 #include "ace/Synch.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 * @class TP_Servant_State_Map
36 * @brief Map of Servant_State objects - one per servant.
38 * A TP_Stategy object holds an instance of a TP_Servant_State_Map object
39 * as a (held-by-value) data member. The strategy uses this map to
40 * find or create the TP_Servant_State object for a particular servant
44 class TAO_CSD_TP_Export TP_Servant_State_Map
47 /// Default Constructor.
48 TP_Servant_State_Map();
51 ~TP_Servant_State_Map();
53 /// Accessor for the servant busy flag.
54 TP_Servant_State
* find(PortableServer::Servant servant
);
56 /// Insert the servant to map.
57 void insert(PortableServer::Servant servant
);
59 /// Remove the servant from map.
60 void remove(PortableServer::Servant servant
);
63 /// Underlying Map Type - Hash-Based -
64 /// Key Type: void*, Value Type: TP_Servant_State::HandleType
65 typedef ACE_Hash_Map_Manager_Ex
<void*,
66 TP_Servant_State::HandleType
,
69 TAO_SYNCH_MUTEX
> MapType
;
71 /// The underlying map of servant state objects.
77 TAO_END_VERSIONED_NAMESPACE_DECL
79 #if defined (__ACE_INLINE__)
80 # include "tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.inl"
81 #endif /* __ACE_INLINE__ */
83 #include /**/ "ace/post.h"
85 #endif /* TAO_CSD_TP_SERVANT_STATE_MAP_H */