#include <Policy_Validator.h>
Collaboration diagram for TAO_Policy_Validator:

Public Member Functions | |
| TAO_Policy_Validator (TAO_ORB_Core &orb_core) | |
| Constructor. | |
| virtual | ~TAO_Policy_Validator (void) |
| Destructor. | |
| void | validate (TAO_Policy_Set &policies) |
| void | merge_policies (TAO_Policy_Set &policies) |
| CORBA::Boolean | legal_policy (CORBA::PolicyType type) |
| void | add_validator (TAO_Policy_Validator *validator) |
| TAO_ORB_Core & | orb_core () const |
Protected Member Functions | |
| virtual void | validate_impl (TAO_Policy_Set &policies)=0 |
| virtual void | merge_policies_impl (TAO_Policy_Set &policies)=0 |
| virtual CORBA::Boolean | legal_policy_impl (CORBA::PolicyType type)=0 |
Protected Attributes | |
| TAO_ORB_Core & | orb_core_ |
Private Attributes | |
| TAO_Policy_Validator * | next_ |
This class was moved from the PortableServer library. The Portable Serever library used this abstraction to add policy validators to for the policies in the POA. This class seems so much useful for passing policy information between different loaded libraries.
Definition at line 53 of file Policy_Validator.h.
|
|
Constructor.
Definition at line 15 of file Policy_Validator.cpp.
|
|
|
Destructor.
Definition at line 21 of file Policy_Validator.cpp.
00022 {
00023 delete this->next_;
00024 }
|
|
|
Adds a validator to the "chain of validators". The Definition at line 33 of file Policy_Validator.cpp. References ACE_ASSERT, ACE_DEBUG, ACE_TEXT, LM_DEBUG, next_, and TAO_debug_level.
00034 {
00035 // The validator we're adding can't be part of another list
00036 ACE_ASSERT (validator->next_ == 0);
00037
00038 // Why would we want to add ourself to our list
00039 if (this != validator)
00040 {
00041 // Get to the end of the list and make sure that the
00042 // new validator isn't already part of our list
00043 TAO_Policy_Validator* current = this;
00044 while (current->next_ != 0)
00045 {
00046 if (current->next_ == validator)
00047 {
00048 if (TAO_debug_level > 3)
00049 {
00050 ACE_DEBUG ((LM_DEBUG,
00051 ACE_TEXT ("(%P|%t) Skipping validator [0x%x] ")
00052 ACE_TEXT ("since it would create a circular list\n"),
00053 validator));
00054 }
00055
00056 return;
00057 }
00058 current = current->next_;
00059 }
00060
00061 // Add the new validator to the end of the list
00062 current->next_ = validator;
00063 }
00064 }
|
|
|
Return whether the specified policy type is legal for the current configuration. This is needed since the user can potentially specify policies that are unknown to an validate () routine, and these need to be caught. Definition at line 90 of file Policy_Validator.cpp. References legal_policy_impl(), and CORBA::PolicyType.
00091 {
00092 return (this->legal_policy_impl (type)
00093 || ((this->next_ != 0)
00094 && this->next_->legal_policy_impl (type)));
00095 }
|
|
|
Referenced by legal_policy(). |
|
|
Add/merge policies. Definition at line 79 of file Policy_Validator.cpp. References merge_policies_impl().
00080 {
00081 this->merge_policies_impl (policies);
00082
00083 if (this->next_)
00084 {
00085 this->next_->merge_policies (policies);
00086 }
00087 }
|
|
|
Referenced by merge_policies(). |
|
|
Accessor for the stored ORB core reference Definition at line 27 of file Policy_Validator.cpp.
00028 {
00029 return this->orb_core_;
00030 }
|
|
|
Validate that the policies in the specified set are consistent and legal. Throw an appropriate exception if that is not the case. Definition at line 68 of file Policy_Validator.cpp. References validate_impl().
00069 {
00070 this->validate_impl (policies);
00071
00072 if (this->next_ != 0)
00073 {
00074 this->next_->validate (policies);
00075 }
00076 }
|
|
|
Referenced by validate(). |
|
|
Definition at line 107 of file Policy_Validator.h. Referenced by add_validator(). |
|
|
Definition at line 104 of file Policy_Validator.h. |
1.3.6