Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Remote_Object_Proxy_Broker.cpp
blob31ed703d13ac8acbee0226b511526b34fc82981f
1 // -*- C++ -*-
2 #include "tao/Remote_Object_Proxy_Broker.h"
3 #include "tao/CORBA_String.h"
4 #include "tao/UB_String_Arguments.h"
5 #include "tao/Special_Basic_Arguments.h"
6 #include "tao/Invocation_Adapter.h"
7 #include "tao/IFR_Client_Adapter.h"
8 #include "tao/ORB_Core.h"
9 #include "tao/SystemException.h"
11 #include "ace/Dynamic_Service.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
15 namespace TAO
17 CORBA::Boolean
18 Remote_Object_Proxy_Broker::_is_a (CORBA::Object_ptr target,
19 const char *type_id)
21 TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
22 TAO::Arg_Traits<char *>::in_arg_val _tao_id (type_id);
24 TAO::Argument *_tao_signature [] =
26 &_tao_retval,
27 &_tao_id
30 TAO::Invocation_Adapter tao_call (target,
31 _tao_signature,
33 "_is_a",
35 TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
37 tao_call.invoke (nullptr, 0);
39 return _tao_retval.retn ();
42 #if (TAO_HAS_MINIMUM_CORBA == 0)
44 CORBA::Boolean
45 Remote_Object_Proxy_Broker::_non_existent (CORBA::Object_ptr target)
47 TAO::Arg_Traits<ACE_InputCDR::to_boolean>::ret_val _tao_retval;
49 TAO::Argument *_tao_signature [] =
51 &_tao_retval
54 TAO::Invocation_Adapter _tao_call (target,
55 _tao_signature,
57 "_non_existent",
58 13,
59 TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
61 _tao_call.invoke (nullptr, 0);
63 return _tao_retval.retn ();
66 CORBA::Object_ptr
67 Remote_Object_Proxy_Broker::_get_component (CORBA::Object_ptr target)
69 TAO::Arg_Traits<CORBA::Object>::ret_val _tao_retval;
71 TAO::Argument *_tao_signature [] =
73 &_tao_retval
76 TAO::Invocation_Adapter _tao_call (target,
77 _tao_signature,
79 "_component",
80 10,
81 TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
83 _tao_call.invoke (nullptr, 0);
85 return _tao_retval.retn ();
88 CORBA::InterfaceDef_ptr
89 Remote_Object_Proxy_Broker::_get_interface (CORBA::Object_ptr target)
91 TAO_IFR_Client_Adapter *adapter =
92 ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
93 TAO_ORB_Core::ifr_client_adapter_name ());
95 if (adapter == nullptr)
97 throw ::CORBA::INTF_REPOS ();
100 return adapter->get_interface_remote (target);
103 char *
104 Remote_Object_Proxy_Broker::_repository_id (CORBA::Object_ptr target)
106 TAO::Arg_Traits< ::CORBA::Char *>::ret_val _tao_retval;
108 TAO::Argument *_tao_signature [] =
110 &_tao_retval
113 TAO::Invocation_Adapter _tao_call (target,
114 _tao_signature,
116 "_repository_id",
118 TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
120 _tao_call.invoke (nullptr, 0);
122 return _tao_retval.retn ();
124 #endif /* TAO_HAS_MINIMUM_CORBA == 0 */
127 // -----------------------------------------------------
129 TAO::Remote_Object_Proxy_Broker *
130 the_tao_remote_object_proxy_broker ()
132 static TAO::Remote_Object_Proxy_Broker the_broker;
133 return &the_broker;
136 TAO_END_VERSIONED_NAMESPACE_DECL