Cache_Entries.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: Cache_Entries.inl 79338 2007-08-14 16:21:42Z mesnier_p $
00004 
00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 namespace TAO
00008 {
00009   ACE_INLINE
00010   Cache_IntId::Cache_IntId (void)
00011     : transport_ (0),
00012       recycle_state_ (ENTRY_UNKNOWN),
00013       is_connected_ (false)
00014   {
00015   }
00016 
00017   ACE_INLINE
00018   Cache_IntId::Cache_IntId (const Cache_IntId &rhs)
00019     : transport_ (0),
00020       recycle_state_ (ENTRY_UNKNOWN),
00021       is_connected_ (false)
00022   {
00023     *this = rhs;
00024   }
00025 
00026   ACE_INLINE bool
00027   Cache_IntId::operator== (const Cache_IntId &rhs) const
00028   {
00029     return (this->transport_ == rhs.transport_);
00030   }
00031 
00032   ACE_INLINE bool
00033   Cache_IntId::operator!= (const Cache_IntId &rhs) const
00034   {
00035     return (this->transport_ != rhs.transport_);
00036   }
00037 
00038   ACE_INLINE TAO_Transport *
00039   Cache_IntId::transport (void)
00040   {
00041     return this->transport_;
00042   }
00043 
00044   ACE_INLINE const TAO_Transport *
00045   Cache_IntId::transport (void) const
00046   {
00047     return this->transport_;
00048   }
00049 
00050   ACE_INLINE void
00051   Cache_IntId::recycle_state (Cache_Entries_State st)
00052   {
00053     this->recycle_state_ = st;
00054   }
00055 
00056   ACE_INLINE Cache_Entries_State
00057   Cache_IntId::recycle_state (void) const
00058   {
00059     return this->recycle_state_;
00060   }
00061 
00062   ACE_INLINE TAO_Transport *
00063   Cache_IntId::relinquish_transport (void)
00064   {
00065     // Yield ownership of the TAO_Transport object.
00066     TAO_Transport *val = this->transport_;
00067     this->transport_ = 0;
00068     return val;
00069   }
00070 
00071   /*******************************************************/
00072   ACE_INLINE
00073   Cache_ExtId::Cache_ExtId (void)
00074     : transport_property_ (0),
00075       is_delete_ (false),
00076       index_ (0)
00077   {
00078   }
00079 
00080   ACE_INLINE
00081   Cache_ExtId::Cache_ExtId (TAO_Transport_Descriptor_Interface *prop)
00082     : transport_property_ (prop),
00083       is_delete_ (false),
00084       index_ (0)
00085   {
00086 
00087   }
00088 
00089   ACE_INLINE
00090   Cache_ExtId::~Cache_ExtId (void)
00091   {
00092     if (this->is_delete_)
00093       delete this->transport_property_;
00094   }
00095 
00096   ACE_INLINE Cache_ExtId &
00097   Cache_ExtId::operator= (const Cache_ExtId &rhs)
00098   {
00099     if (this != &rhs)
00100       {
00101         // Do a deep copy
00102         this->transport_property_ =
00103           rhs.transport_property_->duplicate ();
00104 
00105         if (this->transport_property_ == 0)
00106           {
00107             this->is_delete_ = false;
00108             this->index_ = 0;
00109           }
00110         else
00111           {
00112             this->is_delete_ = true;
00113             this->index_ = rhs.index_;
00114           }
00115       }
00116     return *this;
00117   }
00118 
00119   ACE_INLINE
00120   Cache_ExtId::Cache_ExtId (const Cache_ExtId &rhs)
00121     : transport_property_ (0),
00122       is_delete_ (false),
00123       index_ (0)
00124   {
00125     *this = rhs;
00126   }
00127 
00128   ACE_INLINE bool
00129   Cache_ExtId::operator== (const Cache_ExtId &rhs) const
00130   {
00131     return (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00132             this->index_ == rhs.index_);
00133   }
00134 
00135   ACE_INLINE bool
00136   Cache_ExtId::operator!= (const Cache_ExtId &rhs) const
00137   {
00138     if (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00139         this->index_ == rhs.index_)
00140       return false;
00141 
00142     return true;
00143   }
00144 
00145   ACE_INLINE u_long
00146   Cache_ExtId::hash (void) const
00147   {
00148     return (this->transport_property_->hash () + this->index_);
00149   }
00150 
00151   ACE_INLINE void
00152   Cache_ExtId::duplicate (void)
00153   {
00154     TAO_Transport_Descriptor_Interface *prop = 0;
00155 
00156     // Make a deep copy
00157     prop = this->transport_property_->duplicate ();
00158 
00159     if (prop == 0)
00160       return;
00161 
00162     // Release memory if there was some allocated in the first place
00163     if (this->is_delete_)
00164       delete this->transport_property_;
00165 
00166     this->is_delete_ = true;
00167     this->transport_property_ = prop;
00168   }
00169 
00170 
00171   ACE_INLINE CORBA::ULong
00172   Cache_ExtId::index (void) const
00173   {
00174     return this->index_;
00175   }
00176 
00177 
00178   ACE_INLINE void
00179   Cache_ExtId::index (CORBA::ULong index)
00180   {
00181     this->index_ = index;
00182   }
00183 
00184   ACE_INLINE void
00185   Cache_ExtId::incr_index (void)
00186   {
00187     ++this->index_;
00188   }
00189 
00190   ACE_INLINE TAO_Transport_Descriptor_Interface *
00191   Cache_ExtId::property (void) const
00192   {
00193     return this->transport_property_;
00194   }
00195 }
00196 
00197 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:51 2010 for TAO by  doxygen 1.4.7