#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 55 of file Policy_Validator.h.
|
Constructor.
Definition at line 16 of file Policy_Validator.cpp.
|
|
Destructor.
Definition at line 22 of file Policy_Validator.cpp.
00023 { 00024 delete this->next_; 00025 } |
|
Adds a validator to the "chain of validators". The Definition at line 34 of file Policy_Validator.cpp. References ACE_ASSERT, ACE_DEBUG, ACE_TEXT, LM_DEBUG, next_, and TAO_debug_level.
00035 { 00036 // The validator we're adding can't be part of another list 00037 ACE_ASSERT (validator->next_ == 0); 00038 00039 // Why would we want to add ourself to our list 00040 if (this != validator) 00041 { 00042 // Get to the end of the list and make sure that the 00043 // new validator isn't already part of our list 00044 TAO_Policy_Validator* current = this; 00045 while (current->next_ != 0) 00046 { 00047 if (current->next_ == validator) 00048 { 00049 if (TAO_debug_level > 3) 00050 { 00051 ACE_DEBUG ((LM_DEBUG, 00052 ACE_TEXT ("(%P|%t) Skipping validator [0x%x] ") 00053 ACE_TEXT ("since it would create a circular list\n"), 00054 validator)); 00055 } 00056 00057 return; 00058 } 00059 current = current->next_; 00060 } 00061 00062 // Add the new validator to the end of the list 00063 current->next_ = validator; 00064 } 00065 } |
|
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 97 of file Policy_Validator.cpp. References legal_policy_impl(), and CORBA::PolicyType.
00098 { 00099 return (this->legal_policy_impl (type) 00100 || ((this->next_ != 0) 00101 && this->next_->legal_policy_impl (type))); 00102 } |
|
Referenced by legal_policy(). |
|
Add/merge policies. Definition at line 83 of file Policy_Validator.cpp. References ACE_CHECK, ACE_ENV_ARG_PARAMETER, and merge_policies_impl().
00085 { 00086 this->merge_policies_impl (policies ACE_ENV_ARG_PARAMETER); 00087 ACE_CHECK; 00088 00089 if (this->next_) 00090 { 00091 this->next_->merge_policies (policies ACE_ENV_ARG_PARAMETER); 00092 ACE_CHECK; 00093 } 00094 } |
|
Referenced by merge_policies(). |
|
Accessor for the stored ORB core reference Definition at line 28 of file Policy_Validator.cpp.
00029 { 00030 return this->orb_core_; 00031 } |
|
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 69 of file Policy_Validator.cpp. References ACE_CHECK, ACE_ENV_ARG_PARAMETER, and validate_impl().
|
|
Referenced by validate(). |
|
Definition at line 113 of file Policy_Validator.h. Referenced by add_validator(). |
|
Definition at line 110 of file Policy_Validator.h. |