1 #include "tao/Policy_Validator.h"
3 #include "ace/Log_Msg.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7 TAO_Policy_Validator::TAO_Policy_Validator (TAO_ORB_Core
&orb_core
)
8 : orb_core_ (orb_core
),
13 TAO_Policy_Validator::~TAO_Policy_Validator ()
19 TAO_Policy_Validator::orb_core() const
21 return this->orb_core_
;
25 TAO_Policy_Validator::add_validator (TAO_Policy_Validator
*validator
)
27 // The validator we're adding can't be part of another list
28 ACE_ASSERT (validator
->next_
== nullptr);
30 // Why would we want to add ourself to our list
31 if (this != validator
)
33 // Get to the end of the list and make sure that the
34 // new validator isn't already part of our list
35 TAO_Policy_Validator
* current
= this;
36 while (current
->next_
!= nullptr)
38 if (current
->next_
== validator
)
40 if (TAO_debug_level
> 3)
42 TAOLIB_DEBUG ((LM_DEBUG
,
43 ACE_TEXT ("(%P|%t) Skipping validator [%@] ")
44 ACE_TEXT ("since it would create a circular list\n"),
50 current
= current
->next_
;
53 // Add the new validator to the end of the list
54 current
->next_
= validator
;
59 TAO_Policy_Validator::validate (TAO_Policy_Set
&policies
)
61 this->validate_impl (policies
);
63 if (this->next_
!= nullptr)
65 this->next_
->validate (policies
);
70 TAO_Policy_Validator::merge_policies (TAO_Policy_Set
&policies
)
72 this->merge_policies_impl (policies
);
76 this->next_
->merge_policies (policies
);
81 TAO_Policy_Validator::legal_policy (CORBA::PolicyType type
)
83 return (this->legal_policy_impl (type
)
84 || ((this->next_
!= nullptr)
85 && this->next_
->legal_policy_impl (type
)));
88 TAO_END_VERSIONED_NAMESPACE_DECL