Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / RTPortableServer / RT_POA.h
blob206c1518a42224a0daeb3bc1f13e2163b4ba8479
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RT_POA.h
7 * RT_POA
9 * @author Irfan Pyarali
11 // ===================================================================
13 #ifndef TAO_RT_POA_H
14 #define TAO_RT_POA_H
16 #include /**/ "ace/pre.h"
18 #include "tao/RTPortableServer/rtportableserver_export.h"
20 #include "tao/PortableServer/Regular_POA.h"
21 #include "tao/orbconf.h"
23 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
25 #define TAO_RT_PORTABLESERVER_SAFE_INCLUDE
26 #include "tao/RTPortableServer/RTPortableServerC.h"
27 #undef TAO_RT_PORTABLESERVER_SAFE_INCLUDE
29 #if !defined (ACE_LACKS_PRAGMA_ONCE)
30 # pragma once
31 #endif /* ACE_LACKS_PRAGMA_ONCE */
33 // This is to remove "inherits via dominance" warnings from MSVC.
34 // MSVC is being a little too paranoid.
35 #if defined(_MSC_VER)
36 #pragma warning(push)
37 #pragma warning(disable:4250)
38 #endif /* _MSC_VER */
40 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
42 class TAO_Thread_Pool;
43 class TAO_Thread_Lane;
44 class TAO_PriorityBandedConnectionPolicy;
46 class TAO_RTPortableServer_Export TAO_RT_POA
47 : public virtual RTPortableServer::POA
48 , public virtual TAO_Regular_POA
50 public:
51 // RTCORBA specific methods
52 CORBA::Object_ptr create_reference_with_priority (const char * intf,
53 RTCORBA::Priority priority) override;
55 #if !defined (CORBA_E_MICRO)
56 CORBA::Object_ptr create_reference_with_id_and_priority (const PortableServer::ObjectId & oid,
57 const char * intf,
58 RTCORBA::Priority priority) override;
59 #endif
61 PortableServer::ObjectId * activate_object_with_priority (PortableServer::Servant p_servant,
62 RTCORBA::Priority priority) override;
64 #if !defined (CORBA_E_MICRO)
65 void activate_object_with_id_and_priority (const PortableServer::ObjectId & oid,
66 PortableServer::Servant p_servant,
67 RTCORBA::Priority priority) override;
68 #endif
69 // End RTCORBA specific methods
71 // Standard POA interface methods
72 PortableServer::POA_ptr create_POA (const char *adapter_name,
73 PortableServer::POAManager_ptr poa_manager,
74 const CORBA::PolicyList &policies) override;
76 PortableServer::POA_ptr find_POA (const char *adapter_name,
77 CORBA::Boolean activate_it) override;
79 void destroy (CORBA::Boolean etherealize_objects,
80 CORBA::Boolean wait_for_completion) override;
82 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
84 PortableServer::ThreadPolicy_ptr create_thread_policy (
85 PortableServer::ThreadPolicyValue value) override;
87 #endif /* TAO_HAS_MINIMUM_POA == 0 */
89 #if !defined (CORBA_E_MICRO)
90 PortableServer::LifespanPolicy_ptr create_lifespan_policy (
91 PortableServer::LifespanPolicyValue value) override;
92 #endif
94 #if !defined (CORBA_E_MICRO)
95 PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (
96 PortableServer::IdUniquenessPolicyValue value) override;
97 #endif
99 #if !defined (CORBA_E_MICRO)
100 PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (
101 PortableServer::IdAssignmentPolicyValue value) override;
102 #endif
104 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
105 PortableServer::ImplicitActivationPolicy_ptr
106 create_implicit_activation_policy (
107 PortableServer::ImplicitActivationPolicyValue value) override;
109 PortableServer::ServantRetentionPolicy_ptr
110 create_servant_retention_policy (
111 PortableServer::ServantRetentionPolicyValue value) override;
113 PortableServer::RequestProcessingPolicy_ptr
114 create_request_processing_policy (
115 PortableServer::RequestProcessingPolicyValue value) override;
117 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
119 char * the_name () override;
121 PortableServer::POA_ptr the_parent () override;
123 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
124 PortableServer::POAList *the_children () override;
125 #endif /* TAO_HAS_MINIMUM_POA == 0 */
127 PortableServer::POAManager_ptr the_POAManager () override;
129 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
130 PortableServer::AdapterActivator_ptr the_activator () override;
132 void the_activator (PortableServer::AdapterActivator_ptr adapter_activator) override;
134 PortableServer::ServantManager_ptr get_servant_manager () override;
136 void set_servant_manager (PortableServer::ServantManager_ptr imgr) override;
138 PortableServer::Servant get_servant () override;
140 void set_servant (PortableServer::Servant servant) override;
141 #endif /* TAO_HAS_MINIMUM_POA == 0 */
143 PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant) override;
145 #if !defined (CORBA_E_MICRO)
146 void activate_object_with_id (const PortableServer::ObjectId &id,
147 PortableServer::Servant p_servant) override;
148 #endif
150 void deactivate_object (const PortableServer::ObjectId &oid) override;
152 CORBA::Object_ptr create_reference (const char *intf) override;
154 #if !defined (CORBA_E_MICRO)
155 CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid,
156 const char *intf) override;
157 #endif
159 PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant) override;
161 CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant) override;
163 PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference) override;
165 PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference) override;
167 PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid) override;
169 CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid) override;
171 CORBA::OctetSeq *id () override;
173 // End standard POA interface methods.
175 CORBA::PolicyList *client_exposed_policies (CORBA::Short object_priority) override;
177 TAO_RT_POA (const String &name,
178 PortableServer::POAManager_ptr poa_manager,
179 const TAO_POA_Policy_Set &policies,
180 TAO_Root_POA *parent,
181 ACE_Lock &lock,
182 TAO_SYNCH_MUTEX &thread_lock,
183 TAO_ORB_Core &orb_core,
184 TAO_Object_Adapter *object_adapter);
186 ~TAO_RT_POA () override = default;
188 void *thread_pool () const override;
190 protected:
191 /// Template method for creating new POA's of this type.
192 TAO_Root_POA *new_POA (const String &name,
193 PortableServer::POAManager_ptr poa_manager,
194 const TAO_POA_Policy_Set &policies,
195 TAO_Root_POA *parent,
196 ACE_Lock &lock,
197 TAO_SYNCH_MUTEX &thread_lock,
198 TAO_ORB_Core &orb_core,
199 TAO_Object_Adapter *object_adapter) override;
201 TAO_Stub *key_to_stub_i (const TAO::ObjectKey &key,
202 const char *type_id,
203 CORBA::Short priority) override;
205 void validate_priority (RTCORBA::Priority priority);
207 void validate_policies ();
209 /// Parse the policy list for RT policies and update our
210 /// cached policy instance.
211 void parse_rt_policies (TAO_POA_Policy_Set &policies);
213 size_t endpoint_count ();
215 TAO_Stub *create_stub_object (const TAO::ObjectKey &object_key,
216 const char *type_id,
217 CORBA::PolicyList *policy_list,
218 TAO_Acceptor_Filter *filter,
219 TAO_PriorityBandedConnectionPolicy *priority_bands);
221 int lane_required (TAO_Thread_Lane *lane,
222 TAO_PriorityBandedConnectionPolicy *priority_bands);
224 TAO_Thread_Pool *thread_pool_ {};
227 TAO_END_VERSIONED_NAMESPACE_DECL
229 #if defined(_MSC_VER)
230 #pragma warning(pop)
231 #endif /* _MSC_VER */
233 #if defined (__ACE_INLINE__)
234 # include "tao/RTPortableServer/RT_POA.inl"
235 #endif /* __ACE_INLINE__ */
237 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
239 #include /**/ "ace/post.h"
241 #endif /* TAO_POA_H */