Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Cache_Entries.inl

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

Generated on Mon Jun 16 13:48:02 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002