void
reportResult(CORBA::Request_ptr request)
{
  Miro::Client client;
  Miro::AnyPrinter printer(printName,
                           printType,
                           printLength,
                           printEnums,
                           printTc,
                           printId);

  CORBA::NVList_ptr arguments = request->arguments();
  for (CORBA::ULong i = 0; i < arguments->count(); ++i) {
    cout << "argument name: " << arguments->item(i)->name() << endl;
    CORBA::Any_ptr any = arguments->item(i)->value();

    printer.print(cout, *any);
    cout << endl;
  }

  cout << "return value: " << endl;
  CORBA::Any any = request->return_value();
  printer.print(cout, any);
  cout << endl;
}
예제 #2
0
void TIDorb::core::ContextImpl::set_values(CORBA::NVList_ptr values)
{
  TIDThr::Synchronized sync(*this);	
  
  if (!(values))
    throw  CORBA::BAD_PARAM(0,CORBA::COMPLETED_NO); // "Null NVList reference"

  delete m_values;
  
  CORBA::ULong list_size = values->count();
  
  m_orb->create_list(list_size, m_values);

  for(CORBA::ULong i = 0; i < list_size; i++) 
    set_one_value(values->item(i)->name(), *(values->item(i)->value()));
}
예제 #3
0
void
TAO_CEC_DynamicImplementationServer::is_a (CORBA::ServerRequest_ptr request)
{
  CORBA::NVList_ptr list;

  this->typed_event_channel_->create_list (0, list);

  CORBA::Any any_1;
  any_1._tao_set_typecode(CORBA::_tc_string);

  list->add_value ("value",
                   any_1,
                   CORBA::ARG_IN);

  request->arguments (list);

  CORBA::NamedValue_ptr nv = list->item (0);

  CORBA::Any_ptr ap = nv->value ();
  const char *value = 0;
  *ap >>= value;

  if (TAO_debug_level >= 10)
    {
      ORBSVCS_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("***** TAO_CEC_DynamicImplementationServer::is_a called with value %s *****\n"),
                  value));
    }

  const char *object_id =
    CORBA::_tc_Object->id ();

  if (TAO_debug_level >= 10)
    {
      ORBSVCS_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("***** is_a using Server's RepositoryId %s *****\n"),
                  this->repository_id_));
      ORBSVCS_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("***** is_a using base interface %s *****\n"),
                  object_id));
    }

  CORBA::Boolean result = 0;
  if (ACE_OS::strcmp (value, this->repository_id_) == 0
      || ACE_OS::strcmp (value, object_id) == 0)
    {
      result = 1;
    }
  else
    {
      CORBA::ULong num = this->typed_event_channel_->number_of_base_interfaces ();
      for (CORBA::ULong base=0; base<num; base++)
        {
          if (TAO_debug_level >= 10)
            {
              ORBSVCS_DEBUG ((LM_DEBUG,
                          ACE_TEXT ("***** is_a using base interface %s *****\n"),
                          this->typed_event_channel_->base_interfaces (base) ));
            }

          if (ACE_OS::strcmp (value, this->typed_event_channel_->base_interfaces (base) ) == 0)
            {
              result = 1;
            }
        }
    }

  if (TAO_debug_level >= 10)
    {
      ORBSVCS_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("***** is_a returning %d *****\n"),
                  result));
    }

  CORBA::Any result_any;
  CORBA::Any::from_boolean from_boolean (result);
  result_any <<= from_boolean;

  request->set_result (result_any);
}