Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / BiDir_GIOP / BiDirPolicy_Validator.cpp
blob0357c45c70e620e3e2aa536219153131fbb21815
1 // -*- C++ -*-
2 #include "tao/BiDir_GIOP/BiDirPolicy_Validator.h"
3 #include "tao/BiDir_GIOP/BiDir_Policy_i.h"
4 #include "tao/Policy_Set.h"
5 #include "tao/ORB_Core.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_BiDirPolicy_Validator::TAO_BiDirPolicy_Validator (TAO_ORB_Core &orb_core)
10 : TAO_Policy_Validator (orb_core)
14 void
15 TAO_BiDirPolicy_Validator::validate_impl (TAO_Policy_Set &policies)
17 CORBA::Policy_var policy =
18 policies.get_cached_policy (TAO_CACHED_POLICY_BIDIRECTIONAL_GIOP);
20 BiDirPolicy::BidirectionalPolicy_var srp =
21 BiDirPolicy::BidirectionalPolicy::_narrow (policy.in ());
23 if (!CORBA::is_nil (srp.in ()))
25 BiDirPolicy::BidirectionalPolicyValue val = srp->value ();
27 // Set the flag in the ORB_Core
28 if (val == BiDirPolicy::BOTH)
29 orb_core_.bidir_giop_policy (true);
33 void
34 TAO_BiDirPolicy_Validator::merge_policies_impl (TAO_Policy_Set &)
38 CORBA::Boolean
39 TAO_BiDirPolicy_Validator::legal_policy_impl (CORBA::PolicyType type)
41 return (type == BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE);
44 TAO_END_VERSIONED_NAMESPACE_DECL