3 #include "ace/Log_Msg.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 template <typename TRANSPORT_TYPE> ACE_INLINE
10 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T ()
12 recycle_state_ (ENTRY_UNKNOWN),
17 template <typename TRANSPORT_TYPE> ACE_INLINE
18 Cache_IntId_T<TRANSPORT_TYPE>::Cache_IntId_T (const Cache_IntId_T &rhs)
20 recycle_state_ (ENTRY_UNKNOWN),
26 template <typename TRANSPORT_TYPE> ACE_INLINE bool
27 Cache_IntId_T<TRANSPORT_TYPE>::operator== (const Cache_IntId_T &rhs) const
29 return (this->transport_ == rhs.transport_);
32 template <typename TRANSPORT_TYPE> ACE_INLINE bool
33 Cache_IntId_T<TRANSPORT_TYPE>::operator!= (const Cache_IntId_T &rhs) const
35 return (this->transport_ != rhs.transport_);
38 template <typename TRANSPORT_TYPE> ACE_INLINE
39 typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
40 Cache_IntId_T<TRANSPORT_TYPE>::transport ()
42 return this->transport_;
45 template <typename TRANSPORT_TYPE> ACE_INLINE
46 const typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
47 Cache_IntId_T<TRANSPORT_TYPE>::transport () const
49 return this->transport_;
52 template <typename TRANSPORT_TYPE> ACE_INLINE
54 Cache_IntId_T<TRANSPORT_TYPE>::is_connected () const
56 return this->is_connected_;
59 template <typename TRANSPORT_TYPE> ACE_INLINE
61 Cache_IntId_T<TRANSPORT_TYPE>::is_connected (bool connected)
63 this->is_connected_ = connected;
66 template <typename TRANSPORT_TYPE> ACE_INLINE Cache_Entries_State
67 Cache_IntId_T<TRANSPORT_TYPE>::recycle_state () const
69 return this->recycle_state_;
72 template <typename TRANSPORT_TYPE> ACE_INLINE
73 typename Cache_IntId_T<TRANSPORT_TYPE>::transport_type *
74 Cache_IntId_T<TRANSPORT_TYPE>::relinquish_transport ()
76 // Yield ownership of the TAO_Transport object.
77 transport_type *val = this->transport_;
82 template <typename TRANSPORT_TYPE> ACE_INLINE const char *
83 Cache_IntId_T<TRANSPORT_TYPE>::state_name (Cache_Entries_State st)
85 #define TAO_CACHE_INTID_ENTRY(X) case X: return #X
88 TAO_CACHE_INTID_ENTRY (ENTRY_IDLE_AND_PURGABLE);
89 TAO_CACHE_INTID_ENTRY (ENTRY_PURGABLE_BUT_NOT_IDLE);
90 TAO_CACHE_INTID_ENTRY (ENTRY_BUSY);
91 TAO_CACHE_INTID_ENTRY (ENTRY_CLOSED);
92 TAO_CACHE_INTID_ENTRY (ENTRY_CONNECTING);
93 TAO_CACHE_INTID_ENTRY (ENTRY_UNKNOWN);
95 return "***Unknown enum value, update Cache_IntId_T::state_name()";
96 #undef TAO_CACHE_INTID_ENTRY
99 /*******************************************************/
100 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
101 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T ()
102 : transport_property_ (0),
108 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
109 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T (
110 typename Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::transport_descriptor_type *prop)
111 : transport_property_ (prop),
118 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
119 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::~Cache_ExtId_T ()
121 if (this->is_delete_)
122 delete this->transport_property_;
125 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
126 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE> &
127 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator= (const Cache_ExtId_T &rhs)
132 this->transport_property_ =
133 rhs.transport_property_->duplicate ();
135 if (this->transport_property_ == 0)
137 this->is_delete_ = false;
142 this->is_delete_ = true;
143 this->index_ = rhs.index_;
149 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
150 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::Cache_ExtId_T (const Cache_ExtId_T &rhs)
151 : transport_property_ (0),
158 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE bool
159 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator== (const Cache_ExtId_T &rhs) const
161 return (this->transport_property_->is_equivalent (rhs.transport_property_) &&
162 this->index_ == rhs.index_);
165 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE bool
166 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::operator!= (const Cache_ExtId_T &rhs) const
168 if (this->transport_property_->is_equivalent (rhs.transport_property_) &&
169 this->index_ == rhs.index_)
175 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE u_long
176 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::hash () const
178 return (this->transport_property_->hash () + this->index_);
181 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
182 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::duplicate ()
184 transport_descriptor_type *prop = 0;
187 prop = this->transport_property_->duplicate ();
192 // Release memory if there was some allocated in the first place
193 if (this->is_delete_)
194 delete this->transport_property_;
196 this->is_delete_ = true;
197 this->transport_property_ = prop;
201 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE CORBA::ULong
202 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::index () const
208 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
209 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::index (CORBA::ULong index)
211 this->index_ = index;
214 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE void
215 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::incr_index ()
220 template <typename TRANSPORT_DESCRIPTOR_TYPE> ACE_INLINE
221 typename Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::transport_descriptor_type *
222 Cache_ExtId_T<TRANSPORT_DESCRIPTOR_TYPE>::property () const
224 return this->transport_property_;
228 TAO_END_VERSIONED_NAMESPACE_DECL