#include <POA_Policy_Set.h>
Collaboration diagram for TAO_POA_Policy_Set:
Public Member Functions | |
TAO_POA_Policy_Set (void) | |
TAO_POA_Policy_Set (const TAO_POA_Policy_Set &rhs) | |
~TAO_POA_Policy_Set (void) | |
CORBA::Policy * | get_policy_by_index (CORBA::ULong index) |
CORBA::ULong | num_policies (void) const |
Get the number of policies. | |
CORBA::Policy_ptr | get_cached_policy (TAO_Cached_Policy_Type type) |
Obtain a single cached policy. | |
void | merge_policies (const CORBA::PolicyList &policies) |
void | merge_policy (const CORBA::Policy_ptr policy) |
void | validate_policies (TAO_Policy_Validator &validator, TAO_ORB_Core &orb_core) |
void | add_client_exposed_fixed_policies (CORBA::PolicyList *client_exposed_policies) |
Add all of the client exposed policies to the specified list. | |
TAO_Policy_Set & | policies (void) |
CORBA::Policy_ptr | get_policy (CORBA::PolicyType policy) |
Obtain a single policy. | |
Protected Attributes | |
TAO_Policy_Set | impl_ |
Definition at line 31 of file POA_Policy_Set.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_POA_Policy_Set::TAO_POA_Policy_Set | ( | void | ) |
Definition at line 20 of file POA_Policy_Set.cpp.
00021 : impl_ (TAO_POLICY_POA_SCOPE) 00022 { 00023 }
TAO_POA_Policy_Set::TAO_POA_Policy_Set | ( | const TAO_POA_Policy_Set & | rhs | ) |
TAO_POA_Policy_Set::~TAO_POA_Policy_Set | ( | void | ) |
void TAO_POA_Policy_Set::add_client_exposed_fixed_policies | ( | CORBA::PolicyList * | client_exposed_policies | ) |
Add all of the client exposed policies to the specified list.
Definition at line 36 of file POA_Policy_Set.cpp.
References num_policies(), and TAO_POLICY_CLIENT_EXPOSED.
Referenced by TAO_Root_POA::client_exposed_policies().
00038 { 00039 CORBA::ULong cep_index = client_exposed_policies->length (); 00040 00041 for (CORBA::ULong i = 0; 00042 i < this->num_policies (); 00043 ++i) 00044 { 00045 CORBA::Policy_var policy = this->get_policy_by_index (i); 00046 00047 // If this policy is client exposed, add it to the list. 00048 if (policy->_tao_scope () & TAO_POLICY_CLIENT_EXPOSED) 00049 { 00050 client_exposed_policies->length (cep_index + 1); 00051 (*client_exposed_policies)[cep_index] = policy->copy (); 00052 cep_index++; 00053 } 00054 } 00055 }
ACE_INLINE CORBA::Policy_ptr TAO_POA_Policy_Set::get_cached_policy | ( | TAO_Cached_Policy_Type | type | ) |
Obtain a single cached policy.
Definition at line 20 of file POA_Policy_Set.inl.
References TAO_Policy_Set::get_cached_policy(), and impl_.
00021 { 00022 return this->impl_.get_cached_policy (type); 00023 }
ACE_INLINE CORBA::Policy_ptr TAO_POA_Policy_Set::get_policy | ( | CORBA::PolicyType | policy | ) |
Obtain a single policy.
Definition at line 39 of file POA_Policy_Set.inl.
References TAO_Policy_Set::get_policy(), and impl_.
Referenced by TAO_Root_POA::get_policy().
00040 { 00041 return this->impl_.get_policy (policy); 00042 }
ACE_INLINE CORBA::Policy * TAO_POA_Policy_Set::get_policy_by_index | ( | CORBA::ULong | index | ) |
Returns the policy at the specified index. CORBA::Policy::_nil () is returned if the policy doesn't exist
Definition at line 14 of file POA_Policy_Set.inl.
References TAO_Policy_Set::get_policy_by_index(), and impl_.
Referenced by TAO::Portable_Server::Cached_Policies::update().
00015 { 00016 return this->impl_.get_policy_by_index (index); 00017 }
ACE_INLINE void TAO_POA_Policy_Set::merge_policies | ( | const CORBA::PolicyList & | policies | ) |
Definition at line 26 of file POA_Policy_Set.inl.
References impl_, and TAO_Policy_Set::set_policy_overrides().
Referenced by TAO_POAManager_Factory::create_POAManager().
00027 { 00028 // Add the policies if they don't exist, override them if they do. 00029 this->impl_.set_policy_overrides (policies, CORBA::ADD_OVERRIDE); 00030 }
ACE_INLINE void TAO_POA_Policy_Set::merge_policy | ( | const CORBA::Policy_ptr | policy | ) |
Definition at line 33 of file POA_Policy_Set.inl.
References impl_, and TAO_Policy_Set::set_policy().
Referenced by TAO_Object_Adapter::init_default_policies().
00034 { 00035 this->impl_.set_policy (policy); 00036 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::ULong TAO_POA_Policy_Set::num_policies | ( | void | ) | const |
Get the number of policies.
Definition at line 8 of file POA_Policy_Set.inl.
References impl_, and TAO_Policy_Set::num_policies().
Referenced by add_client_exposed_fixed_policies(), and TAO::Portable_Server::Cached_Policies::update().
00009 { 00010 return this->impl_.num_policies (); 00011 }
ACE_INLINE TAO_Policy_Set & TAO_POA_Policy_Set::policies | ( | void | ) |
Definition at line 45 of file POA_Policy_Set.inl.
References impl_.
Referenced by TAO_POAManager_Factory::create_POAManager().
00046 { 00047 return this->impl_; 00048 }
void TAO_POA_Policy_Set::validate_policies | ( | TAO_Policy_Validator & | validator, | |
TAO_ORB_Core & | orb_core | |||
) |
Definition at line 58 of file POA_Policy_Set.cpp.
References ACE_ERROR, impl_, TAO_Policy_Validator::legal_policy(), LM_ERROR, TAO_ORB_Core::load_policy_validators(), TAO_Policy_Set::num_policies(), and TAO_Policy_Validator::validate().
Referenced by TAO_POAManager_Factory::create_POAManager().
00060 { 00061 // Just give a last chance for all the unloaded validators in other 00062 // libraries to be registered 00063 orb_core.load_policy_validators (validator); 00064 00065 // Validate that all of the specified policies make sense. 00066 validator.validate (this->impl_ ); 00067 00068 // Verify that all policies are legal for the currently loaded 00069 // POA extensions. 00070 for (CORBA::ULong i = 0; 00071 i < this->impl_.num_policies (); 00072 i++) 00073 { 00074 CORBA::Policy_var policy = this->impl_.get_policy_by_index (i); 00075 00076 CORBA::PolicyType type = policy->policy_type (); 00077 00078 if (validator.legal_policy (type) == 0) 00079 { 00080 #if !defined (CORBA_E_MICRO) 00081 // An invalid policy was specified. Let the user know about 00082 // it. 00083 throw PortableServer::POA::InvalidPolicy (); 00084 #else 00085 ACE_ERROR ((LM_ERROR, "Invalid policy\n")); 00086 #endif 00087 } 00088 } 00089 }
TAO_Policy_Set TAO_POA_Policy_Set::impl_ [protected] |
Definition at line 67 of file POA_Policy_Set.h.
Referenced by get_cached_policy(), get_policy(), get_policy_by_index(), merge_policies(), merge_policy(), num_policies(), policies(), and validate_policies().