Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Servant_State_Map.inl
blob32f48ebd24911f5bb2bba033c949755a98a19d97
1 // -*- C++ -*-
2 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
4 ACE_INLINE
5 TAO::CSD::TP_Servant_State_Map::TP_Servant_State_Map()
10 ACE_INLINE
11 TAO::CSD::TP_Servant_State_Map::~TP_Servant_State_Map()
16 ACE_INLINE
17 TAO::CSD::TP_Servant_State*
18 TAO::CSD::TP_Servant_State_Map::find(PortableServer::Servant servant)
20   void* key = servant;
22   TP_Servant_State::HandleType value;
24   if (this->map_.find(key, value) != 0)
25     {
26       throw PortableServer::POA::ServantNotActive ();
27     }
29   return value._retn();
33 ACE_INLINE
34 void
35 TAO::CSD::TP_Servant_State_Map::insert(PortableServer::Servant servant)
37   void* key = servant;
39   TP_Servant_State::HandleType value = new TP_Servant_State ();
41   int const result = this->map_.bind(key, value);
43   if (result == 1)
44     {
45       throw PortableServer::POA::ServantAlreadyActive ();
46     }
48   ACE_ASSERT (result == 0);
52 ACE_INLINE
53 void
54 TAO::CSD::TP_Servant_State_Map::remove(PortableServer::Servant servant)
56   void* key = servant;
58   if (this->map_.unbind(key) == -1)
59     {
60       throw PortableServer::POA::ServantNotActive ();
61     }
64 TAO_END_VERSIONED_NAMESPACE_DECL