Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Servant_State_Map.h
blobc36802cd0718f57aea79f5f8d78db4964de595a5
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_TP_Servant_State_Map.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
8 */
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)
19 # 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
29 namespace TAO
31 namespace CSD
33 /**
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
41 * object.
44 class TAO_CSD_TP_Export TP_Servant_State_Map
46 public:
47 /// Default Constructor.
48 TP_Servant_State_Map();
50 /// Destructor.
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);
62 private:
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,
67 ACE_Hash<void*>,
68 ACE_Equal_To<void*>,
69 TAO_SYNCH_MUTEX> MapType;
71 /// The underlying map of servant state objects.
72 MapType map_;
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 */