Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Cache_Entries_T.cpp
blob2b3bd726512a1378f4bac6f1167426b5114a27ae
1 // -*- C++ -*-
2 # include "tao/Cache_Entries_T.h"
4 #if !defined (__ACE_INLINE__)
5 # include "tao/Cache_Entries_T.inl"
6 #endif /* __ACE_INLINE__ */
8 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 namespace TAO
12 template <typename TRANSPORT_TYPE>
13 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T (TRANSPORT_TYPE *transport)
14 : transport_ (transport)
15 , recycle_state_ (ENTRY_UNKNOWN)
16 , is_connected_ (false)
18 this->is_connected_ = transport->is_connected();
19 transport->add_reference ();
20 if (TAO_debug_level > 9)
21 TAOLIB_DEBUG ((LM_DEBUG,
22 ACE_TEXT ("TAO (%P|%t) - Cache_IntId_T::Cache_IntId_T, ")
23 ACE_TEXT ("this=%@ Transport[%d] is%Cconnected\n"),
24 this, transport->id (), (is_connected_ ? " " : " not ")));
27 template <typename TRANSPORT_TYPE>
28 Cache_IntId_T<TRANSPORT_TYPE>::~Cache_IntId_T ()
30 if (this->transport_)
31 this->transport_->remove_reference ();
34 template <typename TRANSPORT_TYPE>
35 Cache_IntId_T<TRANSPORT_TYPE>&
36 Cache_IntId_T<TRANSPORT_TYPE>::operator= (
37 const Cache_IntId_T<TRANSPORT_TYPE> &rhs)
39 if (this != &rhs)
41 this->recycle_state_ = rhs.recycle_state_;
42 this->is_connected_ = rhs.is_connected_;
43 transport_type *old_transport = this->transport_;
44 this->transport_ = rhs.transport_;
45 if (this->transport_)
46 this->transport_->add_reference ();
47 if (old_transport)
48 old_transport->remove_reference ();
51 return *this;
54 template <typename TRANSPORT_TYPE>
55 void
56 Cache_IntId_T<TRANSPORT_TYPE>::recycle_state (Cache_Entries_State st)
58 if (TAO_debug_level > 9)
59 TAOLIB_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - Cache_IntId_T::")
60 ACE_TEXT ("recycle_state, %C->%C Transport[%d] IntId=%@\n"),
61 state_name (recycle_state_), state_name (st),
62 transport_ ? transport_->id() : 0, this));
63 this->recycle_state_ = st;
67 TAO_END_VERSIONED_NAMESPACE_DECL