diff options
author | smcqueen <smcqueen@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-18 14:55:10 +0000 |
---|---|---|
committer | smcqueen <smcqueen@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-18 14:55:10 +0000 |
commit | f9a2805548ad34f7134c49d4fcdba65330e6dca2 (patch) | |
tree | 5a3efe2343f5f09601d809aaca43c2eb4c1cf178 /TAO/tao/IFR_Client | |
parent | 999a88e99e9e79c5b3cd7002bbdac7e7271840bf (diff) | |
download | ATCD-f9a2805548ad34f7134c49d4fcdba65330e6dca2.tar.gz |
ChangeLogTag: Tue Nov 18 13:59:11 2003 Simon McQueen <sm@prismtechnologies.com>
Diffstat (limited to 'TAO/tao/IFR_Client')
-rw-r--r-- | TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.cpp | 72 | ||||
-rw-r--r-- | TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h | 7 |
2 files changed, 79 insertions, 0 deletions
diff --git a/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.cpp b/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.cpp index 7bbbdc5c792..4c4336104d0 100644 --- a/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.cpp +++ b/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.cpp @@ -5,6 +5,7 @@ #include "tao/ORB_Core.h" #include "tao/Invocation_Adapter.h" #include "tao/Stub.h" +#include "tao/NVList.h" ACE_RCSID (IFR_Client, IFR_Client_Adapter_Impl, @@ -139,6 +140,77 @@ TAO_IFR_Client_Adapter_Impl::get_interface_remote ( return _tao_retval.retn (); } +void +TAO_IFR_Client_Adapter_Impl::create_operation_list ( + CORBA::ORB_ptr orb, + CORBA::OperationDef_ptr opDef, + CORBA::NVList_ptr& result + ACE_ENV_ARG_DECL + ) +{ + // Create an empty NVList. + // + orb->create_list (0, result); + + // Get the parameters (if any) from the OperationDef, and for each + // parameter add a corresponding entry to the result. + // + CORBA::ParDescriptionSeq* params = opDef->params(); + CORBA::ULong paramCount = params->length(); + if (paramCount > 0) + { + for (CORBA::ULong i = 0; i < paramCount; i++) + { + CORBA::ParameterDescription* param = &((*params)[i]); + + // Get name. + // + char* name = CORBA::string_dup (param->name); + + // Create an any using the parameter's TypeCode. + // + CORBA::Any* value; + ACE_NEW_THROW_EX (value, + CORBA::Any (), + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK; + + value->_tao_set_typecode ((param->type).in()); + + // Get mode. + // + CORBA::Flags flags; + switch (param->mode) + { + case CORBA::PARAM_IN: + flags = CORBA::ARG_IN; + break; + case CORBA::PARAM_OUT: + flags = CORBA::ARG_OUT; + break; + case CORBA::PARAM_INOUT: + flags = CORBA::ARG_INOUT; + break; + default: + // Shouldn't happen. + // + ACE_THROW (CORBA::INTERNAL()); + break; + } + + // Add an argument to the result list. The list takes ownership + // of name and value. + // + result->add_value_consume (name, value, flags); + } + } + +} + // ********************************************************************* // Initialization and registration of dynamic service object. diff --git a/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h b/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h index 0b2c5ee841b..9265afab785 100644 --- a/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h +++ b/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h @@ -65,6 +65,13 @@ public: CORBA::Object_ptr target ACE_ENV_ARG_DECL ); + + virtual void create_operation_list ( + CORBA::ORB_ptr orb, + CORBA::OperationDef_ptr, + CORBA::NVList_ptr& + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); // Used to force the initialization of the ORB code. static int Initializer (void); |