Go to the documentation of this file.00001
00002
00003 # include "tao/Cache_Entries_T.h"
00004
00005 #if !defined (__ACE_INLINE__)
00006 # include "tao/Cache_Entries_T.inl"
00007 #endif
00008
00009 ACE_RCSID(tao,
00010 Cache_Entries,
00011 "$Id: Cache_Entries_T.cpp 85436 2009-05-25 21:57:28Z coryan $")
00012
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015 namespace TAO
00016 {
00017 template <typename TRANSPORT_TYPE>
00018 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T (TRANSPORT_TYPE *transport)
00019 : transport_ (transport)
00020 , recycle_state_ (ENTRY_UNKNOWN)
00021 , is_connected_ (false)
00022 {
00023 this->is_connected_ = transport->is_connected();
00024 transport->add_reference ();
00025 if (TAO_debug_level > 9)
00026 ACE_DEBUG ((LM_DEBUG,
00027 ACE_TEXT ("TAO (%P|%t) - Cache_IntId_T::Cache_IntId_T, ")
00028 ACE_TEXT ("this=%@ Transport[%d] is%Cconnected\n"),
00029 this, transport->id (), (is_connected_ ? " " : " not ")));
00030 }
00031
00032 template <typename TRANSPORT_TYPE>
00033 Cache_IntId_T<TRANSPORT_TYPE>::~Cache_IntId_T (void)
00034 {
00035 if (this->transport_)
00036 this->transport_->remove_reference ();
00037 }
00038
00039 template <typename TRANSPORT_TYPE>
00040 Cache_IntId_T<TRANSPORT_TYPE>&
00041 Cache_IntId_T<TRANSPORT_TYPE>::operator= (
00042 const Cache_IntId_T<TRANSPORT_TYPE> &rhs)
00043 {
00044 if (this != &rhs)
00045 {
00046 this->recycle_state_ = rhs.recycle_state_;
00047 this->is_connected_ = rhs.is_connected_;
00048 transport_type *old_transport = this->transport_;
00049 this->transport_ = rhs.transport_;
00050 if (this->transport_)
00051 this->transport_->add_reference ();
00052 if (old_transport)
00053 old_transport->remove_reference ();
00054 }
00055
00056 return *this;
00057 }
00058
00059 template <typename TRANSPORT_TYPE>
00060 void
00061 Cache_IntId_T<TRANSPORT_TYPE>::recycle_state (Cache_Entries_State st)
00062 {
00063 if (TAO_debug_level > 9)
00064 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - Cache_IntId_T::")
00065 ACE_TEXT ("recycle_state, %C->%C Transport[%d] IntId=%@\n"),
00066 state_name (recycle_state_), state_name (st),
00067 transport_ ? transport_->id() : 0, this));
00068 this->recycle_state_ = st;
00069 }
00070 }
00071
00072 TAO_END_VERSIONED_NAMESPACE_DECL