Exemple #1
0
int
Collocation_Test::test_narrow (void)
{
  Diamond::Top_var top =
    Diamond::Top::_narrow (this->diamond_obj_.in ());

  Diamond::Left_var left =
    Diamond::Left::_narrow (this->diamond_obj_.in ());

  Diamond::Right_var right =
    Diamond::Right::_narrow (this->diamond_obj_.in ());

  Diamond::Buttom_var buttom =
    Diamond::Buttom::_narrow (this->diamond_obj_.in ());

  CORBA::String_var str = top->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling top->shape: %C\n", str.in ()));

  str = left->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling left->shape: %C\n", str.in ()));

  str = right->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling right->shape: %C\n", str.in ()));

  str = buttom->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling buttom->shape: %C\n", str.in ()));

  return 0;
}
Exemple #2
0
int
Collocation_Test::test_narrow (void)
{
  // Ensure that the smart proxy is the one which is used by registering
  // the user-defined factory. Its necessary to create one on the heap so
  // the lifetime of the factory object can be managed by the framework.
  Smart_Diamond_Top_Factory *factory = 0;
  ACE_NEW_RETURN (factory,
                  Smart_Diamond_Top_Factory,
                  -1);

  Diamond::Top_var top =
    Diamond::Top::_narrow (this->diamond_obj_.in());

  Diamond::Left_var left =
    Diamond::Left::_narrow (this->diamond_obj_.in());

  Diamond::Right_var right =
    Diamond::Right::_narrow (this->diamond_obj_.in());

  Diamond::Buttom_var buttom =
    Diamond::Buttom::_narrow (this->diamond_obj_.in());

  CORBA::String_var str = top->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling top->shape: %s\n", str.in ()));

  str = left->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling left->shape: %s\n", str.in ()));

  str = right->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling right->shape: %s\n", str.in ()));

  str = buttom->shape ();
  ACE_DEBUG ((LM_DEBUG, "Calling buttom->shape: %s\n", str.in ()));

  return 0;
}