diff options
author | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-12 18:58:44 +0000 |
---|---|---|
committer | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-12 18:58:44 +0000 |
commit | 8d40b91422e328d03a0cda9dc91a9cb92458aa52 (patch) | |
tree | 468291519f5de84e2d73520262cff279db26aa67 /TAO/tao/Policy_Manager.i | |
parent | 0d2e3d69b72f8f9dad3402500a1b77d4a579c43a (diff) | |
download | ATCD-8d40b91422e328d03a0cda9dc91a9cb92458aa52.tar.gz |
Tue Jun 12 13:30:02 2001 Frank Hunleth <fhunleth@cs.wustl.edu>, Angelo Corsaro <corsaro@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Policy_Manager.i')
-rw-r--r-- | TAO/tao/Policy_Manager.i | 291 |
1 files changed, 20 insertions, 271 deletions
diff --git a/TAO/tao/Policy_Manager.i b/TAO/tao/Policy_Manager.i index fb353b44358..e4252dbd222 100644 --- a/TAO/tao/Policy_Manager.i +++ b/TAO/tao/Policy_Manager.i @@ -1,41 +1,8 @@ // $Id$ ACE_INLINE -TAO_Policy_Manager_Impl::TAO_Policy_Manager_Impl (void) - : count_ (0) -{ - this->relative_roundtrip_timeout_ = 0; - -#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) - - this->client_priority_ = 0; - -#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ - - this->sync_scope_ = 0; - -#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) - - this->buffering_constraint_ = 0; - -#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ - -#if (TAO_HAS_RT_CORBA == 1) - - this->priority_model_ = 0; - this->threadpool_ = 0; - this->private_connection_ = 0; - this->priority_banded_connection_ = 0; - this->server_protocol_ = 0; - this->client_protocol_ = 0; - -#endif /* TAO_HAS_RT_CORBA == 1 */ -} - -// **************************************************************** - -ACE_INLINE TAO_Policy_Manager::TAO_Policy_Manager (void) + : impl_ (TAO_POLICY_ORB_SCOPE) { } @@ -74,142 +41,32 @@ TAO_Policy_Manager::set_policy_overrides ( this->impl_.set_policy_overrides (policies, set_add, ACE_TRY_ENV); } -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::relative_roundtrip_timeout (void) -{ - // Double-checked locking. - if (this->impl_.relative_roundtrip_timeout_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.relative_roundtrip_timeout (); - } - return 0; -} - -#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) - -ACE_INLINE TAO_Client_Priority_Policy * -TAO_Policy_Manager::client_priority (void) -{ - // Double-checked locking. - if (this->impl_.client_priority_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.client_priority (); - } - return 0; -} - -#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ - -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::sync_scope (void) -{ - // Double-checked locking. - if (this->impl_.sync_scope_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.sync_scope (); - } - return 0; -} - -#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) - -ACE_INLINE TAO_Buffering_Constraint_Policy * -TAO_Policy_Manager::buffering_constraint (void) +ACE_INLINE CORBA::Policy_ptr +TAO_Policy_Manager::get_cached_policy (TAO_Cached_Policy_Type type) { - // Double-checked locking. - if (this->impl_.buffering_constraint_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.buffering_constraint (); - } - return 0; -} -#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ + // @@ Previous code used a "double-checked locking hack" to check + // if the policy was set before grabbing the lock to actually get + // it, so that could save a lock operation. This was removed, as + // it is not as easy to do this anymore. -#if (TAO_HAS_RT_CORBA == 1) - -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::priority_model (void) -{ - // Double-checked locking. - if (this->impl_.priority_model_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.priority_model (); - } - return 0; -} + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::threadpool (void) -{ - // Double-checked locking. - if (this->impl_.threadpool_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.threadpool (); - } - return 0; + return this->impl_.get_cached_policy (type); } -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::private_connection (void) -{ - // Double-checked locking. - if (this->impl_.private_connection_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.private_connection (); - } - return 0; -} -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::priority_banded_connection (void) -{ - // Double-checked locking. - if (this->impl_.priority_banded_connection_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.priority_banded_connection (); - } - return 0; -} -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::server_protocol (void) -{ - // Double-checked locking. - if (this->impl_.server_protocol_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.server_protocol (); - } - return 0; -} +// **************************************************************** -ACE_INLINE CORBA::Policy * -TAO_Policy_Manager::client_protocol (void) +ACE_INLINE +TAO_Policy_Current::TAO_Policy_Current (void) { - // Double-checked locking. - if (this->impl_.client_protocol_) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0); - return this->impl_.client_protocol (); - } - return 0; } -#endif /* TAO_HAS_RT_CORBA == 1 */ - -// **************************************************************** - ACE_INLINE -TAO_Policy_Current::TAO_Policy_Current (void) +TAO_Policy_Current_Impl::TAO_Policy_Current_Impl (void) + : manager_impl_ (TAO_POLICY_THREAD_SCOPE) { } @@ -221,61 +78,12 @@ TAO_Policy_Current_Impl::get_policy ( return this->manager_impl_.get_policy (policy, ACE_TRY_ENV); } -ACE_INLINE CORBA::Policy * -TAO_Policy_Current_Impl::relative_roundtrip_timeout (void) const -{ - return this->manager_impl_.relative_roundtrip_timeout (); -} - -#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) - -ACE_INLINE TAO_Client_Priority_Policy * -TAO_Policy_Current_Impl::client_priority (void) const -{ - return this->manager_impl_.client_priority (); -} - -#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current_Impl::sync_scope (void) const -{ - return this->manager_impl_.sync_scope (); -} - -#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) - -ACE_INLINE TAO_Buffering_Constraint_Policy * -TAO_Policy_Current_Impl::buffering_constraint (void) const -{ - return this->manager_impl_.buffering_constraint (); -} - -#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ - -#if (TAO_HAS_RT_CORBA == 1) - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current_Impl::private_connection (void) const -{ - return this->manager_impl_.private_connection (); -} - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current_Impl::priority_banded_connection (void) const -{ - return this->manager_impl_.priority_banded_connection (); -} - - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current_Impl::client_protocol (void) const +ACE_INLINE CORBA::Policy_ptr +TAO_Policy_Current_Impl::get_cached_policy (TAO_Cached_Policy_Type type) { - return this->manager_impl_.client_protocol (); + return this->manager_impl_.get_cached_policy (type); } -#endif /* TAO_HAS_RT_CORBA == 1 */ - // **************************************************************** ACE_INLINE CORBA::Policy_ptr @@ -312,70 +120,11 @@ TAO_Policy_Current::set_policy_overrides (const CORBA::PolicyList & policies, impl.set_policy_overrides (policies, set_add, ACE_TRY_ENV); } -ACE_INLINE CORBA::Policy * -TAO_Policy_Current::relative_roundtrip_timeout (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.relative_roundtrip_timeout (); -} - -#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) - -ACE_INLINE TAO_Client_Priority_Policy * -TAO_Policy_Current::client_priority (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.client_priority (); -} - -#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current::sync_scope (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.sync_scope (); -} - -#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) - -ACE_INLINE TAO_Buffering_Constraint_Policy * -TAO_Policy_Current::buffering_constraint (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.buffering_constraint (); -} - -#endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ - -#if (TAO_HAS_RT_CORBA == 1) - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current::private_connection (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.private_connection (); -} - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current::priority_banded_connection (void) const -{ - TAO_Policy_Current_Impl &impl = this->implementation (); - - return impl.priority_banded_connection (); -} - -ACE_INLINE CORBA::Policy * -TAO_Policy_Current::client_protocol (void) const +ACE_INLINE CORBA::Policy_ptr +TAO_Policy_Current::get_cached_policy (TAO_Cached_Policy_Type type) { TAO_Policy_Current_Impl &impl = this->implementation (); - return impl.client_protocol (); + return impl.get_cached_policy (type); } -#endif /* TAO_HAS_RT_CORBA == 1 */ |