Go to the documentation of this file.00001
00002
00003
00004
00005 #include "tao/debug.h"
00006 #include "ace/Log_Msg.h"
00007
00008 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00009
00010 namespace TAO
00011 {
00012 template <typename TRANSPORT_TYPE> ACE_INLINE
00013 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T (void)
00014 : transport_ (0),
00015 recycle_state_ (ENTRY_UNKNOWN),
00016 is_connected_ (false)
00017 {
00018 }
00019
00020 template <typename TRANSPORT_TYPE> ACE_INLINE
00021 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T (const Cache_IntId_T &rhs)
00022 : transport_ (0),
00023 recycle_state_ (ENTRY_UNKNOWN),
00024 is_connected_ (false)
00025 {
00026 *this = rhs;
00027 }
00028
00029 template <typename TRANSPORT_TYPE> ACE_INLINE bool
00030 Cache_IntId_T<TRANSPORT_TYPE>::operator== (const Cache_IntId_T &rhs) const
00031 {
00032 return (this->transport_ == rhs.transport_);
00033 }
00034
00035 template <typename TRANSPORT_TYPE> ACE_INLINE bool
00036 Cache_IntId_T<TRANSPORT_TYPE>::operator!= (const Cache_IntId_T &rhs) const
00037 {
00038 return (this->transport_ != rhs.transport_);
00039 }
00040
00041 template <typename TRANSPORT_TYPE> ACE_INLINE
00042 typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
00043 Cache_IntId_T<TRANSPORT_TYPE>::transport (void)
00044 {
00045 return this->transport_;
00046 }
00047
00048 template <typename TRANSPORT_TYPE> ACE_INLINE
00049 const typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
00050 Cache_IntId_T<TRANSPORT_TYPE>::transport (void) const
00051 {
00052 return this->transport_;
00053 }
00054
00055 template <typename TRANSPORT_TYPE> ACE_INLINE
00056 bool
00057 Cache_IntId_T<TRANSPORT_TYPE>::is_connected (void) const
00058 {
00059 return this->is_connected_;
00060 }
00061
00062 template <typename TRANSPORT_TYPE> ACE_INLINE
00063 void
00064 Cache_IntId_T<TRANSPORT_TYPE>::is_connected (bool connected)
00065 {
00066 this->is_connected_ = connected;
00067 }
00068
00069 template <typename TRANSPORT_TYPE> ACE_INLINE Cache_Entries_State
00070 Cache_IntId_T<TRANSPORT_TYPE>::recycle_state (void) const
00071 {
00072 return this->recycle_state_;
00073 }
00074
00075 template <typename TRANSPORT_TYPE> ACE_INLINE
00076 typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
00077 Cache_IntId_T<TRANSPORT_TYPE>::relinquish_transport (void)
00078 {
00079
00080 transport_type *val = this->transport_;
00081 this->transport_ = 0;
00082 return val;
00083 }
00084
00085 template <typename TRANSPORT_TYPE> ACE_INLINE const char *
00086 Cache_IntId_T<TRANSPORT_TYPE>::state_name (Cache_Entries_State st)
00087 {
00088 #define TAO_CACHE_INTID_ENTRY(X) case X: return #X
00089 switch (st)
00090 {
00091 TAO_CACHE_INTID_ENTRY (ENTRY_IDLE_AND_PURGABLE);
00092 TAO_CACHE_INTID_ENTRY (ENTRY_PURGABLE_BUT_NOT_IDLE);
00093 TAO_CACHE_INTID_ENTRY (ENTRY_BUSY);
00094 TAO_CACHE_INTID_ENTRY (ENTRY_CLOSED);
00095 TAO_CACHE_INTID_ENTRY (ENTRY_CONNECTING);
00096 TAO_CACHE_INTID_ENTRY (ENTRY_UNKNOWN);
00097 }
00098 return "***Unknown enum value, update Cache_IntId_T::state_name()";
00099 #undef TAO_CACHE_INTID_ENTRY
00100 }
00101
00102
00103 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00104 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T (void)
00105 : transport_property_ (0),
00106 is_delete_ (false),
00107 index_ (0)
00108 {
00109 }
00110
00111 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00112 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T (
00113 typename Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::transport_descriptor_type *prop)
00114 : transport_property_ (prop),
00115 is_delete_ (false),
00116 index_ (0)
00117 {
00118
00119 }
00120
00121 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00122 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::~Cache_ExtId_T (void)
00123 {
00124 if (this->is_delete_)
00125 delete this->transport_property_;
00126 }
00127
00128 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00129 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE> &
00130 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator= (const Cache_ExtId_T &rhs)
00131 {
00132 if (this != &rhs)
00133 {
00134
00135 this->transport_property_ =
00136 rhs.transport_property_->duplicate ();
00137
00138 if (this->transport_property_ == 0)
00139 {
00140 this->is_delete_ = false;
00141 this->index_ = 0;
00142 }
00143 else
00144 {
00145 this->is_delete_ = true;
00146 this->index_ = rhs.index_;
00147 }
00148 }
00149 return *this;
00150 }
00151
00152 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00153 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T (const Cache_ExtId_T &rhs)
00154 : transport_property_ (0),
00155 is_delete_ (false),
00156 index_ (0)
00157 {
00158 *this = rhs;
00159 }
00160
00161 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE bool
00162 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator== (const Cache_ExtId_T &rhs) const
00163 {
00164 return (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00165 this->index_ == rhs.index_);
00166 }
00167
00168 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE bool
00169 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator!= (const Cache_ExtId_T &rhs) const
00170 {
00171 if (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00172 this->index_ == rhs.index_)
00173 return false;
00174
00175 return true;
00176 }
00177
00178 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE u_long
00179 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::hash (void) const
00180 {
00181 return (this->transport_property_->hash () + this->index_);
00182 }
00183
00184 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
00185 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::duplicate (void)
00186 {
00187 transport_descriptor_type *prop = 0;
00188
00189
00190 prop = this->transport_property_->duplicate ();
00191
00192 if (prop == 0)
00193 return;
00194
00195
00196 if (this->is_delete_)
00197 delete this->transport_property_;
00198
00199 this->is_delete_ = true;
00200 this->transport_property_ = prop;
00201 }
00202
00203
00204 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE CORBA::ULong
00205 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::index (void) const
00206 {
00207 return this->index_;
00208 }
00209
00210
00211 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
00212 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::index (CORBA::ULong index)
00213 {
00214 this->index_ = index;
00215 }
00216
00217 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
00218 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::incr_index (void)
00219 {
00220 ++this->index_;
00221 }
00222
00223 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
00224 typename Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::transport_descriptor_type *
00225 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::property (void) const
00226 {
00227 return this->transport_property_;
00228 }
00229 }
00230
00231 TAO_END_VERSIONED_NAMESPACE_DECL