00001
00002
00003
00004
00005 #include "tao/ORB_Core.h"
00006
00007 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00008
00009 ACE_INLINE void
00010 TAO_Stub::reset_base (void)
00011 {
00012 this->base_profiles_.rewind ();
00013 this->profile_success_ = false;
00014
00015 this->set_profile_in_use_i (base_profiles_.get_next ());
00016 }
00017
00018
00019 ACE_INLINE ACE_Lock*
00020 TAO_Stub::profile_lock (void) const
00021 {
00022 return this->profile_lock_ptr_;
00023 }
00024
00025 ACE_INLINE void
00026 TAO_Stub::reset_forward (void)
00027 {
00028 while (this->forward_profiles_ != 0)
00029 this->forward_back_one ();
00030 }
00031
00032 ACE_INLINE void
00033 TAO_Stub::reset_profiles_i (void)
00034 {
00035 this->reset_forward ();
00036 this->reset_base ();
00037 }
00038
00039 ACE_INLINE void
00040 TAO_Stub::reset_profiles (void)
00041 {
00042 ACE_MT (ACE_GUARD (ACE_Lock,
00043 guard,
00044 *this->profile_lock_ptr_));
00045 this->reset_profiles_i ();
00046 }
00047
00048 ACE_INLINE TAO_Profile *
00049 TAO_Stub::profile_in_use (void)
00050 {
00051 return this->profile_in_use_;
00052 }
00053
00054 ACE_INLINE TAO_MProfile *
00055 TAO_Stub::make_profiles (void)
00056 {
00057 TAO_MProfile *mp = 0;
00058
00059 ACE_NEW_RETURN (mp,
00060 TAO_MProfile (base_profiles_),
00061 0);
00062
00063 return mp;
00064 }
00065
00066 ACE_INLINE TAO_Profile *
00067 TAO_Stub::next_forward_profile (void)
00068 {
00069 TAO_Profile *pfile_next = 0;
00070
00071 while (this->forward_profiles_
00072 && (pfile_next = this->forward_profiles_->get_next ()) == 0
00073 && this->forward_profiles_ != this->forward_profiles_perm_)
00074
00075
00076 this->forward_back_one ();
00077
00078 return pfile_next;
00079 }
00080
00081 ACE_INLINE TAO_Profile *
00082 TAO_Stub::next_profile_i (void)
00083 {
00084 TAO_Profile *pfile_next = 0;
00085
00086
00087 if (this->forward_profiles_perm_)
00088
00089
00090 {
00091
00092
00093 pfile_next = this->next_forward_profile ();
00094
00095 if (pfile_next == 0)
00096 {
00097
00098
00099
00100
00101
00102 this->forward_profiles_->rewind ();
00103 this->profile_success_ = false;
00104 this->set_profile_in_use_i (this->forward_profiles_->get_next());
00105 }
00106 else
00107 this->set_profile_in_use_i (pfile_next);
00108
00109
00110
00111 this->orb_core_->reinitialize_object (this);
00112
00113 return pfile_next;
00114 }
00115 else
00116 {
00117 if (this->forward_profiles_)
00118 {
00119 pfile_next = this->next_forward_profile ();
00120 if (pfile_next == 0)
00121 {
00122
00123 pfile_next = this->base_profiles_.get_next ();
00124 }
00125
00126
00127
00128 this->orb_core_->reinitialize_object (this);
00129 }
00130 else
00131 pfile_next = this->base_profiles_.get_next ();
00132
00133 if (pfile_next == 0)
00134 this->reset_base ();
00135 else
00136 this->set_profile_in_use_i (pfile_next);
00137
00138 return pfile_next;
00139 }
00140 }
00141
00142 ACE_INLINE TAO_Profile *
00143 TAO_Stub::next_profile (void)
00144 {
00145
00146 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00147 guard,
00148 *this->profile_lock_ptr_,
00149 0));
00150 return this->next_profile_i ();
00151 }
00152
00153 ACE_INLINE CORBA::Boolean
00154 TAO_Stub::valid_forward_profile (void)
00155 {
00156 return (this->profile_success_ && this->forward_profiles_);
00157 }
00158
00159 ACE_INLINE void
00160 TAO_Stub::set_valid_profile (void)
00161 {
00162 this->profile_success_ = true;
00163 }
00164
00165 ACE_INLINE CORBA::Boolean
00166 TAO_Stub::valid_profile (void) const
00167 {
00168 return this->profile_success_;
00169 }
00170
00171 ACE_INLINE TAO_Profile *
00172 TAO_Stub::base_profiles (const TAO_MProfile &mprofiles)
00173 {
00174 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00175 guard,
00176 *this->profile_lock_ptr_,
00177 0));
00178
00179
00180
00181
00182
00183
00184 this->reset_forward ();
00185 this->base_profiles_.set (mprofiles);
00186 this->reset_base ();
00187 return this->profile_in_use_;
00188
00189 }
00190
00191 ACE_INLINE CORBA::Boolean
00192 TAO_Stub::next_profile_retry (void)
00193 {
00194 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00195 guard,
00196 *this->profile_lock_ptr_,
00197 0));
00198
00199 if (this->profile_success_ && this->forward_profiles_)
00200 {
00201
00202
00203
00204
00205
00206 this->reset_profiles_i ();
00207 return true;
00208 }
00209 else if (this->next_profile_i ())
00210 {
00211 return true;
00212 }
00213
00214 return false;
00215 }
00216
00217 ACE_INLINE const TAO_MProfile&
00218 TAO_Stub::base_profiles (void) const
00219 {
00220 return this->base_profiles_;
00221 }
00222
00223 ACE_INLINE TAO_MProfile&
00224 TAO_Stub::base_profiles (void)
00225 {
00226 return this->base_profiles_;
00227 }
00228
00229 ACE_INLINE const TAO_MProfile *
00230 TAO_Stub::forward_profiles (void) const
00231 {
00232 return this->forward_profiles_;
00233 }
00234
00235 ACE_INLINE CORBA::Boolean
00236 TAO_Stub::is_collocated (void) const
00237 {
00238 return this->is_collocated_;
00239 }
00240
00241 ACE_INLINE TAO_ORB_Core*
00242 TAO_Stub::orb_core (void) const
00243 {
00244 return this->orb_core_.get ();
00245 }
00246
00247 ACE_INLINE CORBA::ORB_var &
00248 TAO_Stub::servant_orb_var (void)
00249 {
00250
00251 return this->servant_orb_;
00252 }
00253
00254 ACE_INLINE CORBA::ORB_ptr
00255 TAO_Stub::servant_orb_ptr (void)
00256 {
00257
00258 return CORBA::ORB::_duplicate (this->servant_orb_.in ());
00259 }
00260
00261 ACE_INLINE void
00262 TAO_Stub::servant_orb (CORBA::ORB_ptr orb)
00263 {
00264 this->servant_orb_ = CORBA::ORB::_duplicate (orb);
00265 }
00266
00267 ACE_INLINE TAO_Abstract_ServantBase *
00268 TAO_Stub::collocated_servant (void) const
00269 {
00270 return collocated_servant_;
00271 }
00272
00273 ACE_INLINE void
00274 TAO_Stub::collocated_servant (TAO_Abstract_ServantBase * servant)
00275 {
00276 this->collocated_servant_ = servant;
00277 }
00278
00279 ACE_INLINE TAO::Object_Proxy_Broker *
00280 TAO_Stub::object_proxy_broker (void) const
00281 {
00282 return this->object_proxy_broker_;
00283 }
00284
00285 ACE_INLINE void
00286 TAO_Stub::object_proxy_broker (TAO::Object_Proxy_Broker * object_proxy_broker)
00287 {
00288 this->object_proxy_broker_ = object_proxy_broker;
00289 }
00290
00291 ACE_INLINE void
00292 TAO_Stub::destroy (void)
00293 {
00294
00295 delete this;
00296 }
00297
00298 ACE_INLINE CORBA::Boolean
00299 TAO_Stub::optimize_collocation_objects (void) const
00300 {
00301 return this->collocation_opt_;
00302 }
00303
00304 ACE_INLINE TAO::Transport_Queueing_Strategy *
00305 TAO_Stub::transport_queueing_strategy (void)
00306 {
00307 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00308
00309 bool has_synchronization;
00310 Messaging::SyncScope scope;
00311
00312 this->orb_core_->call_sync_scope_hook (this, has_synchronization, scope);
00313
00314 if (has_synchronization == true)
00315 return this->orb_core_->get_transport_queueing_strategy (this, scope);
00316 #endif
00317
00318
00319 return 0;
00320 }
00321
00322
00323
00324
00325 ACE_INLINE
00326 TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr (TAO_Stub *p)
00327 : p_ (p)
00328 {
00329 ACE_TRACE ("TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr");
00330 }
00331
00332 ACE_INLINE TAO_Stub *
00333 TAO_Stub_Auto_Ptr::get (void) const
00334 {
00335 ACE_TRACE ("TAO_Stub_Auto_Ptr::get");
00336 return this->p_;
00337 }
00338
00339 ACE_INLINE TAO_Stub *
00340 TAO_Stub_Auto_Ptr::release (void)
00341 {
00342 ACE_TRACE ("TAO_Stub_Auto_Ptr::release");
00343 TAO_Stub *old = this->p_;
00344 this->p_ = 0;
00345 return old;
00346 }
00347
00348 ACE_INLINE void
00349 TAO_Stub_Auto_Ptr::reset (TAO_Stub *p)
00350 {
00351 ACE_TRACE ("TAO_Stub_Auto_Ptr::reset");
00352 if (this->get () != p && this->get () != 0)
00353 this->get ()->_decr_refcnt ();
00354 this->p_ = p;
00355 }
00356
00357 ACE_INLINE TAO_Stub *
00358 TAO_Stub_Auto_Ptr::operator-> () const
00359 {
00360 ACE_TRACE ("TAO_Stub_Auto_Ptr::operator->");
00361 return this->get ();
00362 }
00363
00364 ACE_INLINE
00365 TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr (TAO_Stub_Auto_Ptr &rhs)
00366 : p_ (rhs.release ())
00367 {
00368 ACE_TRACE ("TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr");
00369 }
00370
00371 ACE_INLINE TAO_Stub_Auto_Ptr &
00372 TAO_Stub_Auto_Ptr::operator= (TAO_Stub_Auto_Ptr &rhs)
00373 {
00374 ACE_TRACE ("TAO_Stub_Auto_Ptr::operator=");
00375 if (this != &rhs)
00376 {
00377 this->reset (rhs.release ());
00378 }
00379 return *this;
00380 }
00381
00382 ACE_INLINE
00383 TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr (void)
00384 {
00385 ACE_TRACE ("TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr");
00386 if (this->get() != 0)
00387 this->get ()->_decr_refcnt ();
00388 }
00389
00390
00391
00392 ACE_INLINE TAO_Stub &
00393 TAO_Stub_Auto_Ptr::operator *() const
00394 {
00395 ACE_TRACE ("TAO_Stub_Auto_Ptr::operator *()");
00396
00397 return *this->get ();
00398 }
00399
00400 TAO_END_VERSIONED_NAMESPACE_DECL