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


C++ Test_var::myMethod方法代码示例

本文整理汇总了C++中Test_var::myMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ Test_var::myMethod方法的具体用法?C++ Test_var::myMethod怎么用?C++ Test_var::myMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Test_var的用法示例。


在下文中一共展示了Test_var::myMethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: svc

/// Thread entry point
int Client_Task::svc (void)
{
  try
    {
      // Get a ref to the IORManipulation object
      CORBA::Object_var IORM =
        corb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
        0);

      // Narrow
      this->iorm_ =
        TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in());

      CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1);

      CORBA::String_var iorgr_string =
        corb_->object_to_string (iogr.in ());

      CORBA::Object_var object =
        corb_->string_to_object (iorgr_string.in ());

      Test_var server =
        Test::_narrow (object.in ());

      if (CORBA::is_nil (server.in ()))
        {
          ACE_ERROR_RETURN ((LM_ERROR,
            "Object reference <%s> is nil\n", iorgr_string.in()), 1);
        }

      CORBA::Object_var remote_server(
        corb_->string_to_object (ACE_TString(file_prefix + this->server_ior_file_).c_str()));

      Test_var remote_server_as_test =
        Test::_narrow (remote_server.in ());

      CORBA::Object_var collocated_server(
        corb_->string_to_object (ACE_TString(file_prefix + this->collocated_ior_file_).c_str()));

      Test_var collocated_server_as_test =
        Test::_narrow (collocated_server.in ());

      if (!collocated_server->_is_collocated())
        { // Collocation is disabled, just skip the test - it has no sense.
          ACE_DEBUG ((LM_ERROR, "Test has no sense, because collocation is disabled.\n") );
        }
      else
        {
          try
          {
            // Following call will fail if the problem is not fixed.

            // Because we are using TRANSIENT objects with the SYSTEM_ID policy
            // the object keys won't match so the POA won't be able to dispatch locally.
            // This wouldn't work with 'direct' collocation strategy but the default is 'through poa'.
            server->myMethod ();
          }
          catch (const CORBA::Exception& ex)
          {
            ex._tao_print_exception ("Exception caught in client task:");
          }
        }

      remote_server_as_test->shutdown();

      collocated_server_as_test->shutdown();
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Exception caught in client task:");
      return 1;
    }

  return 0;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:76,代码来源:Client_Task.cpp


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