当前位置: 首页>>代码示例>>C++>>正文


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怎么用?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));
}
开发者ID:chenbk85,项目名称:ACE-Middleware,代码行数:25,代码来源:client.cpp

示例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;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:75,代码来源:client.cpp


注:本文中的Simple_Server_var::test_is_a方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。