3 //=============================================================================
5 * @file Policy_Validator.h
7 * This file contains the declaration for the POA policy validator
10 * @author Angelo Corsaro <corsaro@cs.wustl.edu>
11 * @author Frank Hunleth <fhuntleth@cs.wustl.edu>
13 //=============================================================================
15 #ifndef TAO_POLICY_VALIDATOR_H
16 #define TAO_POLICY_VALIDATOR_H
18 #include /**/ "ace/pre.h"
20 #include "tao/Basic_Types.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include /**/ "tao/TAO_Export.h"
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 // Forward declarations.
36 typedef ULong PolicyType
;
40 * @class TAO_Policy_Validator
42 * @brief An abstract class for plugging in different Policy Validator
45 * This class was moved from the PortableServer library. The Portable
46 * Serever library used this abstraction to add policy validators to
47 * for the policies in the POA. This class seems so much useful for
48 * passing policy information between different loaded libraries.
50 class TAO_Export TAO_Policy_Validator
54 TAO_Policy_Validator (TAO_ORB_Core
&orb_core
);
57 virtual ~TAO_Policy_Validator ();
60 * Validate that the policies in the specified set
61 * are consistent and legal. Throw an appropriate exception
62 * if that is not the case.
64 void validate (TAO_Policy_Set
&policies
);
69 void merge_policies (TAO_Policy_Set
&policies
);
72 * Return whether the specified policy type is legal for the
73 * current configuration. This is needed since the user can
74 * potentially specify policies that are unknown to an
75 * validate () routine, and these need to be caught.
77 CORBA::Boolean
legal_policy (CORBA::PolicyType type
);
80 * Adds a validator to the "chain of validators". The <code>
81 * TAO_POA_Policy_Validator </code> implements something that looks
82 * like a chain of responsability in which different member of the
83 * chain have the responsability of validating a given set of
86 void add_validator (TAO_Policy_Validator
*validator
);
89 * Accessor for the stored ORB core reference
91 TAO_ORB_Core
& orb_core() const;
94 virtual void validate_impl (TAO_Policy_Set
&policies
) = 0;
96 virtual void merge_policies_impl (TAO_Policy_Set
&policies
) = 0;
98 virtual CORBA::Boolean
legal_policy_impl (CORBA::PolicyType type
) = 0;
100 TAO_ORB_Core
&orb_core_
;
103 void operator= (const TAO_Policy_Validator
&);
104 TAO_Policy_Validator (const TAO_Policy_Validator
&);
107 TAO_Policy_Validator
*next_
;
110 TAO_END_VERSIONED_NAMESPACE_DECL
112 #include /**/ "ace/post.h"
114 #endif /* TAO_POLICY_VALIDATOR_H */