本文整理汇总了C++中Simple_Server_var::test_is_a方法的典型用法代码示例。如果您正苦于以下问题:C++ Simple_Server_var::test_is_a方法的具体用法?C++ Simple_Server_var::test_is_a怎么用?C++ Simple_Server_var::test_is_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simple_Server_var
的用法示例。
在下文中一共展示了Simple_Server_var::test_is_a方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Worker::run_test (void)
{
CORBA::Object_var object =
this->orb_->string_to_object (ior);
Simple_Server_var server =
Simple_Server::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR ((LM_ERROR,
"Object reference <%s> is nil.\n",
ior));
return;
}
CORBA::Boolean r =
server->test_is_a ("IDL:Foo:1.0");
if (r != 0)
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) unexpected result = %d\n",
r));
}
示例2: catch
int
Worker::svc (void)
{
try
{
CORBA::Object_var object =
this->orb_->string_to_object (ior);
Simple_Server_var server =
Simple_Server::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR ((LM_ERROR,
"Object reference <%s> is nil.\n",
ior));
return 0;
}
try {
CORBA::Boolean r =
server->test_is_a ("IDL:Foo:1.0");
this->invocation_completed_ = true;
if (r != 0)
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) unexpected result = %d\n",
r));
}
catch (const CORBA::OBJECT_NOT_EXIST &)
{
ACE_DEBUG ((LM_DEBUG, "(%P|%t)received OBJECT_NOT_EXIST \n"));
if (!this->done_)
{
++ this->num_received_ex_;
received_ex_kind_ |= TAO::FOE_OBJECT_NOT_EXIST;
}
}
catch (const CORBA::COMM_FAILURE &)
{
ACE_DEBUG ((LM_DEBUG, "(%P|%t)received COMM_FAILURE \n"));
if (!this->done_)
{
++ this->num_received_ex_;
received_ex_kind_ |= TAO::FOE_COMM_FAILURE;
}
}
catch (const CORBA::TRANSIENT &)
{
ACE_DEBUG ((LM_DEBUG, "(%P|%t)received TRANSIENT \n"));
if (!this->done_)
{
++ this->num_received_ex_;
received_ex_kind_ |= TAO::FOE_TRANSIENT;
}
}
catch (const CORBA::INV_OBJREF &)
{
ACE_DEBUG ((LM_DEBUG, "(%P|%t)received INV_OBJREF \n"));
if (!this->done_)
{
++ this->num_received_ex_;
received_ex_kind_ |= TAO::FOE_INV_OBJREF;
}
}
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Unexpected exception caught");
}
return 0;
}