Public Member Functions | Protected Attributes

TAO_POA_Policy_Set Class Reference

#include <POA_Policy_Set.h>

Collaboration diagram for TAO_POA_Policy_Set:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_POA_Policy_Set (void)
 TAO_POA_Policy_Set (const TAO_POA_Policy_Set &rhs)
 ~TAO_POA_Policy_Set (void)
CORBA::Policyget_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_Setpolicies (void)
CORBA::Policy_ptr get_policy (CORBA::PolicyType policy)
 Obtain a single policy.

Protected Attributes

TAO_Policy_Set impl_

Detailed Description

Definition at line 31 of file POA_Policy_Set.h.


Constructor & Destructor Documentation

TAO_POA_Policy_Set::TAO_POA_Policy_Set ( void   ) 

Definition at line 20 of file POA_Policy_Set.cpp.

TAO_POA_Policy_Set::TAO_POA_Policy_Set ( const TAO_POA_Policy_Set rhs  ) 

Definition at line 25 of file POA_Policy_Set.cpp.

  :
    impl_ (rhs.impl_)
{
}

TAO_POA_Policy_Set::~TAO_POA_Policy_Set ( void   ) 

Definition at line 31 of file POA_Policy_Set.cpp.

{
}


Member Function Documentation

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.

{
  CORBA::ULong cep_index = client_exposed_policies->length ();

  for (CORBA::ULong i = 0;
       i < this->num_policies ();
       ++i)
    {
      CORBA::Policy_var policy = this->get_policy_by_index (i);

      // If this policy is client exposed, add it to the list.
      if (policy->_tao_scope () & TAO_POLICY_CLIENT_EXPOSED)
        {
          client_exposed_policies->length (cep_index + 1);
          (*client_exposed_policies)[cep_index] = policy->copy ();
          ++cep_index;
        }
    }
}

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.

{
  return this->impl_.get_cached_policy (type);
}

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.

{
  return this->impl_.get_policy (policy);
}

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.

{
  return this->impl_.get_policy_by_index (index);
}

void TAO_POA_Policy_Set::merge_policies ( const CORBA::PolicyList &  policies  ) 

Definition at line 26 of file POA_Policy_Set.inl.

{
  // Add the policies if they don't exist, override them if they do.
  this->impl_.set_policy_overrides (policies, CORBA::ADD_OVERRIDE);
}

void TAO_POA_Policy_Set::merge_policy ( const CORBA::Policy_ptr  policy  ) 

Definition at line 33 of file POA_Policy_Set.inl.

{
  this->impl_.set_policy (policy);
}

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.

{
  return this->impl_.num_policies ();
}

TAO_Policy_Set & TAO_POA_Policy_Set::policies ( void   ) 

Definition at line 45 of file POA_Policy_Set.inl.

{
  return this->impl_;
}

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.

{
  // Just give a last chance for all the unloaded validators in other
  // libraries to be registered
  orb_core.load_policy_validators (validator);

  // Validate that all of the specified policies make sense.
  validator.validate (this->impl_ );

  // Verify that all policies are legal for the currently loaded
  // POA extensions.
  for (CORBA::ULong i = 0;
       i < this->impl_.num_policies ();
       i++)
    {
      CORBA::Policy_var policy = this->impl_.get_policy_by_index (i);

      CORBA::PolicyType type = policy->policy_type ();

      if (!(validator.legal_policy (type)))
        {
#if !defined (CORBA_E_MICRO)
          // An invalid policy was specified.  Let the user know about
          // it.
          throw PortableServer::POA::InvalidPolicy ();
#else
          ACE_ERROR ((LM_ERROR, "Invalid policy\n"));
#endif
        }
    }
}


Member Data Documentation

Definition at line 67 of file POA_Policy_Set.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines