An abstract class for plugging in different Policy Validator mechanisms. More...
#include <Policy_Validator.h>
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 Member Functions | |
void | operator= (const TAO_Policy_Validator &) |
TAO_Policy_Validator (const TAO_Policy_Validator &) | |
Private Attributes | |
TAO_Policy_Validator * | next_ |
An abstract class for plugging in different Policy Validator mechanisms.
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 52 of file Policy_Validator.h.
TAO_Policy_Validator::TAO_Policy_Validator | ( | TAO_ORB_Core & | orb_core | ) |
Constructor.
Definition at line 15 of file Policy_Validator.cpp.
TAO_Policy_Validator::~TAO_Policy_Validator | ( | void | ) | [virtual] |
TAO_Policy_Validator::TAO_Policy_Validator | ( | const TAO_Policy_Validator & | ) | [private] |
void TAO_Policy_Validator::add_validator | ( | TAO_Policy_Validator * | validator | ) |
Adds a validator to the "chain of validators". The TAO_POA_Policy_Validator
implements something that looks like a chain of responsability in which different member of the chain have the responsability of validating a given set of policies.
Definition at line 33 of file Policy_Validator.cpp.
{ // The validator we're adding can't be part of another list ACE_ASSERT (validator->next_ == 0); // Why would we want to add ourself to our list if (this != validator) { // Get to the end of the list and make sure that the // new validator isn't already part of our list TAO_Policy_Validator* current = this; while (current->next_ != 0) { if (current->next_ == validator) { if (TAO_debug_level > 3) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Skipping validator [0x%x] ") ACE_TEXT ("since it would create a circular list\n"), validator)); } return; } current = current->next_; } // Add the new validator to the end of the list current->next_ = validator; } }
CORBA::Boolean TAO_Policy_Validator::legal_policy | ( | CORBA::PolicyType | type | ) |
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.
{ return (this->legal_policy_impl (type) || ((this->next_ != 0) && this->next_->legal_policy_impl (type))); }
virtual CORBA::Boolean TAO_Policy_Validator::legal_policy_impl | ( | CORBA::PolicyType | type | ) | [protected, pure virtual] |
void TAO_Policy_Validator::merge_policies | ( | TAO_Policy_Set & | policies | ) |
Add/merge policies.
Definition at line 79 of file Policy_Validator.cpp.
{ this->merge_policies_impl (policies); if (this->next_) { this->next_->merge_policies (policies); } }
virtual void TAO_Policy_Validator::merge_policies_impl | ( | TAO_Policy_Set & | policies | ) | [protected, pure virtual] |
void TAO_Policy_Validator::operator= | ( | const TAO_Policy_Validator & | ) | [private] |
TAO_ORB_Core & TAO_Policy_Validator::orb_core | ( | void | ) | const |
Accessor for the stored ORB core reference
Definition at line 27 of file Policy_Validator.cpp.
{ return this->orb_core_; }
void TAO_Policy_Validator::validate | ( | TAO_Policy_Set & | policies | ) |
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.
{ this->validate_impl (policies); if (this->next_ != 0) { this->next_->validate (policies); } }
virtual void TAO_Policy_Validator::validate_impl | ( | TAO_Policy_Set & | policies | ) | [protected, pure virtual] |
TAO_Policy_Validator* TAO_Policy_Validator::next_ [private] |
Definition at line 109 of file Policy_Validator.h.
TAO_ORB_Core& TAO_Policy_Validator::orb_core_ [protected] |
Definition at line 102 of file Policy_Validator.h.