3 #include "tao/IFR_Client/IFR_BasicC.h"
4 #include "tao/ORB_Core.h"
7 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
12 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
14 TAO_IFR_Client_Adapter
*ifr_client
=
15 ACE_Dynamic_Service
<TAO_IFR_Client_Adapter
>::instance (
16 TAO_ORB_Core::ifr_client_adapter_name ());
20 throw ::CORBA::INTF_REPOS ();
23 ACE_DEBUG ((LM_DEBUG
, "Got IFR_Client ref.\n"));
25 CORBA::InterfaceDef_var intDef
=
26 ifr_client
->get_interface (orb
.in (), "IDL:IFR_Test/test_if:1.0");
28 if (CORBA::is_nil (intDef
.in ()))
30 ACE_ERROR_RETURN ((LM_ERROR
,
31 "get interface returned nil ref\n"),
35 CORBA::ContainedSeq_var attributes
=
36 intDef
->contents (CORBA::dk_Attribute
, 1);
37 CORBA::ULong n_ats
= attributes
->length ();
39 CORBA::ULong index
= 0UL;
40 CORBA::String_var name
= attributes
[index
]->name ();
42 "found %d attributes, name = %s\n",
46 CORBA::AttributeDef_var attr
=
47 CORBA::AttributeDef::_narrow (attributes
[index
]);
49 if (CORBA::is_nil (attr
.in ()))
51 ACE_ERROR_RETURN ((LM_ERROR
,
52 "could not narrow attribute ref\n"),
56 CORBA::TypeCode_var tc
= attr
->type ();
58 ACE_DEBUG ((LM_DEBUG
, "foo attr typecode = %s\n", tc
->id ()));
60 catch (const ::CORBA::Exception
&ex
)
62 ex
._tao_print_exception("ERROR : unexpected CORBA exception caugth :");