Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / RTPortableServer / RT_Policy_Validator.h
blobafab3f0f46eb991894821464465d66cf8fc5ced4
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RT_Policy_Validator.h
7 * This file contains the declaration for the RTCORBA policy validator.
9 * @author Angelo Corsaro <corsaro@cs.wustl.edu>
10 * @author Frank Hunleth <fhuntleth@cs.wustl.edu>
12 //=============================================================================
14 #ifndef TAO_RT_POLICY_VALIDATOR_H_
15 #define TAO_RT_POLICY_VALIDATOR_H_
17 #include /**/ "ace/pre.h"
19 #include "tao/orbconf.h"
21 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 # pragma once
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 #include "tao/RTPortableServer/rtportableserver_export.h"
28 #include "tao/Policy_Validator.h"
29 #include "tao/RTCORBA/RTCORBA.h"
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 class TAO_ORB_Core;
34 class TAO_Acceptor_Registry;
35 class TAO_Thread_Pool;
37 class TAO_RTPortableServer_Export TAO_POA_RT_Policy_Validator
38 : public TAO_Policy_Validator
40 public:
41 /// Constructor.
42 TAO_POA_RT_Policy_Validator (TAO_ORB_Core &orb_core);
44 /// Destructor.
45 ~TAO_POA_RT_Policy_Validator () override = default;
47 static RTCORBA::ServerProtocolPolicy_ptr server_protocol_policy_from_thread_pool (TAO_Thread_Pool *thread_pool,
48 TAO_ORB_Core &orb_core);
50 static void server_protocol_policy_from_acceptor_registry (RTCORBA::ProtocolList &protocols,
51 TAO_Acceptor_Registry &acceptor_registry,
52 TAO_ORB_Core &orb_core);
54 static TAO_Thread_Pool *extract_thread_pool (TAO_ORB_Core &orb_core,
55 TAO_Policy_Set &policies);
57 protected:
58 /**
59 * Validate that the policies in the specified set
60 * are consistent and legal. Throw an appropriate exception
61 * if that is not the case.
63 void validate_impl (TAO_Policy_Set &policies) override;
65 /// Add/merge policies.
66 void merge_policies_impl (TAO_Policy_Set &policies) override;
68 /**
69 * Return whether the specified policy type is legal for the
70 * current configuration. This is needed since the user can
71 * potentially specify policies that are unknown to an
72 * validate () routine, and these need to be caught.
74 CORBA::Boolean legal_policy_impl (CORBA::PolicyType type) override;
76 private:
77 void validate_server_protocol (TAO_Policy_Set &policies);
79 void validate_priorities (TAO_Policy_Set &policies);
81 void validate_thread_pool (TAO_Policy_Set &policies);
83 TAO_Thread_Pool *thread_pool_;
86 TAO_END_VERSIONED_NAMESPACE_DECL
88 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
90 #include /**/ "ace/post.h"
92 #endif /* TAO_RT_POLICY_VALIDATOR_H_ */