Policy Validator for ZIOP policies. More...
#include <ZIOP_Policy_Validator.h>
Public Member Functions | |
TAO_ZIOPPolicy_Validator (TAO_ORB_Core &orb_core) | |
virtual void | validate_impl (TAO_Policy_Set &policies) |
virtual void | merge_policies_impl (TAO_Policy_Set &policies) |
virtual CORBA::Boolean | legal_policy_impl (CORBA::PolicyType type) |
Policy Validator for ZIOP policies.
Definition at line 40 of file ZIOP_Policy_Validator.h.
TAO_ZIOPPolicy_Validator::TAO_ZIOPPolicy_Validator | ( | TAO_ORB_Core & | orb_core | ) |
Definition at line 15 of file ZIOP_Policy_Validator.cpp.
: TAO_Policy_Validator (orb_core) { }
CORBA::Boolean TAO_ZIOPPolicy_Validator::legal_policy_impl | ( | CORBA::PolicyType | type | ) | [virtual] |
Implements TAO_Policy_Validator.
Definition at line 114 of file ZIOP_Policy_Validator.cpp.
{
return (type == ZIOP::COMPRESSION_ENABLING_POLICY_ID ||
type == ZIOP::COMPRESSION_LOW_VALUE_POLICY_ID ||
type == ZIOP::COMPRESSION_MIN_RATIO_POLICY_ID ||
type == ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID);
}
void TAO_ZIOPPolicy_Validator::merge_policies_impl | ( | TAO_Policy_Set & | policies | ) | [virtual] |
Implements TAO_Policy_Validator.
Definition at line 38 of file ZIOP_Policy_Validator.cpp.
{ // Check if the user has specified the compression enabled policy. CORBA::Policy_var compression_enabled = policies.get_cached_policy (TAO_CACHED_COMPRESSION_ENABLING_POLICY); if (CORBA::is_nil (compression_enabled.in ())) { // If not, check if the compression enabled policy has been specified // at the ORB level. compression_enabled = this->orb_core_.get_cached_policy (TAO_CACHED_COMPRESSION_ENABLING_POLICY); if (!CORBA::is_nil (compression_enabled.in ())) { // If so, we'll use that policy. policies.set_policy (compression_enabled.in ()); } } // Check if the user has specified the compression low value policy. CORBA::Policy_var low_value_policy = policies.get_cached_policy (TAO_CACHED_COMPRESSION_LOW_VALUE_POLICY); if (CORBA::is_nil (low_value_policy.in ())) { // If not, check if the compression low value policy has been // specified at the ORB level. low_value_policy = this->orb_core_.get_cached_policy (TAO_CACHED_COMPRESSION_LOW_VALUE_POLICY); if (!CORBA::is_nil (low_value_policy.in ())) { // If so, we'll use that policy. policies.set_policy (low_value_policy.in ()); } } // Check if the user has specified the minimum compression ratio policy. CORBA::Policy_var min_ratio_policy = policies.get_cached_policy (TAO_CACHED_MIN_COMPRESSION_RATIO_POLICY); if (CORBA::is_nil (min_ratio_policy.in ())) { // If not, check if the minimum compression ratio policy has been // specified at the ORB level. min_ratio_policy = this->orb_core_.get_cached_policy (TAO_CACHED_MIN_COMPRESSION_RATIO_POLICY); if (!CORBA::is_nil (min_ratio_policy.in ())) { // If so, we'll use that policy. policies.set_policy (min_ratio_policy.in ()); } } // Check if the user has specified the compression list policy. CORBA::Policy_var compressior_list_policy = policies.get_cached_policy (TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY); if (CORBA::is_nil (compressior_list_policy.in ())) { // If not, check if the compression list policy has been // specified at the ORB level. compressior_list_policy = this->orb_core_.get_cached_policy (TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY); if (!CORBA::is_nil (compressior_list_policy.in ())) { // If so, we'll use that policy. policies.set_policy (compressior_list_policy.in ()); } } }
void TAO_ZIOPPolicy_Validator::validate_impl | ( | TAO_Policy_Set & | policies | ) | [virtual] |
Implements TAO_Policy_Validator.
Definition at line 22 of file ZIOP_Policy_Validator.cpp.
{ CORBA::Policy_var policy = policies.get_cached_policy (TAO_CACHED_COMPRESSION_ENABLING_POLICY); if (policy.in () == 0) return; ZIOP::CompressionEnablingPolicy_var srp = ZIOP::CompressionEnablingPolicy::_narrow (policy.in ()); if (srp.in () == 0) return; }