Public Member Functions | Static Public Member Functions

TAO_IFR_Client_Adapter_Impl Class Reference

TAO_IFR_Client_Adapter_Impl. More...

#include <IFR_Client_Adapter_Impl.h>

Inheritance diagram for TAO_IFR_Client_Adapter_Impl:
Inheritance graph
[legend]
Collaboration diagram for TAO_IFR_Client_Adapter_Impl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~TAO_IFR_Client_Adapter_Impl (void)
virtual CORBA::Boolean interfacedef_cdr_insert (TAO_OutputCDR &cdr, CORBA::InterfaceDef_ptr object_type)
virtual void interfacedef_any_insert (CORBA::Any *any, CORBA::InterfaceDef_ptr object_type)
virtual void dispose (CORBA::InterfaceDef_ptr orphan)
virtual CORBA::InterfaceDef_ptr get_interface (CORBA::ORB_ptr orb, const char *repo_id)
virtual CORBA::InterfaceDef_ptr get_interface_remote (CORBA::Object_ptr target)
virtual void create_operation_list (CORBA::ORB_ptr orb, CORBA::OperationDef_ptr, CORBA::NVList_ptr &)

Static Public Member Functions

static int Initializer (void)

Detailed Description

TAO_IFR_Client_Adapter_Impl.

Class that adapts various functions in the CORBA namespace which use the Interface Repository. This is the derived class that contains the actual implementations.

Definition at line 40 of file IFR_Client_Adapter_Impl.h.


Constructor & Destructor Documentation

TAO_IFR_Client_Adapter_Impl::~TAO_IFR_Client_Adapter_Impl ( void   )  [virtual]

Definition at line 36 of file IFR_Client_Adapter_Impl.cpp.

{
}


Member Function Documentation

void TAO_IFR_Client_Adapter_Impl::create_operation_list ( CORBA::ORB_ptr  orb,
CORBA::OperationDef_ptr  opDef,
CORBA::NVList_ptr result 
) [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 141 of file IFR_Client_Adapter_Impl.cpp.

{
  // 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_var params =
    opDef->params ();

  CORBA::ULong paramCount = params->length ();

  for (CORBA::ULong i = 0; i < paramCount; ++i)
    {
      CORBA::Any value;
      TAO::Unknown_IDL_Type *unk = 0;
      ACE_NEW (unk,
               TAO::Unknown_IDL_Type (params[i].type.in ()));
      value.replace (unk);

      // Convert the parameter mode to an arg mode
      CORBA::Flags flags = 0;
      switch(params[i].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
          throw ::CORBA::INTERNAL();
        }

      // Add an argument to the NVList.
      result->add_value (params[i].name.in (),
                         value,
                         flags);
   }
}

void TAO_IFR_Client_Adapter_Impl::dispose ( CORBA::InterfaceDef_ptr  orphan  )  [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 59 of file IFR_Client_Adapter_Impl.cpp.

{
  ::CORBA::release (orphan);
}

CORBA::InterfaceDef_ptr TAO_IFR_Client_Adapter_Impl::get_interface ( CORBA::ORB_ptr  orb,
const char *  repo_id 
) [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 67 of file IFR_Client_Adapter_Impl.cpp.

{
  CORBA::Object_var obj =
    orb->resolve_initial_references ("InterfaceRepository"
                                    );

  if (CORBA::is_nil (obj.in ()))
    {
      throw ::CORBA::INTF_REPOS ();
    }

  CORBA::Repository_var repo =
    CORBA::Repository::_narrow (obj.in ()
                               );

  if (CORBA::is_nil (repo.in ()))
    {
      throw ::CORBA::INTF_REPOS ();
    }

  CORBA::Contained_var result = repo->lookup_id (repo_id
                                                );

  if (CORBA::is_nil (result.in ()))
    {
      return CORBA::InterfaceDef::_nil ();
    }
  else
    {
      return CORBA::InterfaceDef::_narrow (result.in ()
                                          );
    }
}

CORBA::InterfaceDef_ptr TAO_IFR_Client_Adapter_Impl::get_interface_remote ( CORBA::Object_ptr  target  )  [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 106 of file IFR_Client_Adapter_Impl.cpp.

{
  TAO::Arg_Traits<CORBA::InterfaceDef>::ret_val _tao_retval;

  TAO::Argument *_tao_signature [] =
    {
      &_tao_retval
    };

  TAO::Invocation_Adapter _tao_call (
      target,
      _tao_signature,
      1,
      "_interface",
      10,
      0
    );

  try
    {
      _tao_call.invoke (0, 0);
    }
  catch (const ::CORBA::OBJECT_NOT_EXIST&)
    {
      return CORBA::InterfaceDef::_nil ();
    }

  return _tao_retval.retn ();
}

int TAO_IFR_Client_Adapter_Impl::Initializer ( void   )  [static]

Definition at line 199 of file IFR_Client_Adapter_Impl.cpp.

{
  TAO_ORB_Core::ifr_client_adapter_name ("Concrete_IFR_Client_Adapter");

  return ACE_Service_Config::process_directive (ace_svc_desc_TAO_IFR_Client_Adapter_Impl);
}

void TAO_IFR_Client_Adapter_Impl::interfacedef_any_insert ( CORBA::Any any,
CORBA::InterfaceDef_ptr  object_type 
) [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 50 of file IFR_Client_Adapter_Impl.cpp.

{
  (*any) <<= object_type;
}

CORBA::Boolean TAO_IFR_Client_Adapter_Impl::interfacedef_cdr_insert ( TAO_OutputCDR cdr,
CORBA::InterfaceDef_ptr  object_type 
) [virtual]

Implements TAO_IFR_Client_Adapter.

Definition at line 41 of file IFR_Client_Adapter_Impl.cpp.

{
  return cdr << object_type;
}


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines