本文整理汇总了C++中corba::Object_var::_get_interface方法的典型用法代码示例。如果您正苦于以下问题:C++ Object_var::_get_interface方法的具体用法?C++ Object_var::_get_interface怎么用?C++ Object_var::_get_interface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Object_var
的用法示例。
在下文中一共展示了Object_var::_get_interface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paramType
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var tmp =
orb->string_to_object(ior);
CORBA::InterfaceDef_var ifd = tmp->_get_interface();
if ( ! CORBA::is_nil (ifd.in()))
{
CORBA::InterfaceDef::FullInterfaceDescription *id = ifd->describe_interface();
CORBA::TypeCode_var paramType (id->operations[0].parameters[0].type.in());
if (paramType->member_count () != 2)
{
ACE_ERROR_RETURN((LM_ERROR,
ACE_TEXT("ERROR Incorrect parameter member count %d expected 2.\n"),
paramType->member_count ()),
1);
}
CORBA::TypeCode_var exceptionType (id->operations[0].exceptions[0].type.in());
if (exceptionType->member_count () != 1)
{
ACE_ERROR_RETURN((LM_ERROR,
ACE_TEXT("ERROR Incorrect exception member count %d expected 1.\n"),
exceptionType->member_count ()),
1);
}
}
else
{
ACE_ERROR_RETURN((LM_ERROR,
ACE_TEXT("ERROR failed to get interface for object.\n")),
1);
}
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught:");
return 1;
}
return 0;
}
示例2: catch
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var tmp =
orb->string_to_object(ior);
CORBA::InterfaceDef_var ifd = tmp->_get_interface();
if ( ! CORBA::is_nil (ifd.in()))
{
CORBA::InterfaceDef::FullInterfaceDescription *id = ifd->describe_interface();
if ( id == 0 )
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT("Null interface description returned\n")));
}
}
Test::GoodDay_var goodday =
Test::GoodDay::_narrow(tmp.in ());
if (CORBA::is_nil (goodday.in ()))
{
ACE_ERROR ((LM_DEBUG,
ACE_TEXT("Nil Test::GoodDay reference <%s>\n"),
ior));
}
else
{
CORBA::String_var the_string =
goodday->get_string ();
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%P|%t) - string returned <%s>\n"),
the_string.in ()));
}
goodday->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught:");
return 1;
}
return 0;
}