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


C++ TAO_IOR_Manipulation_var::add_profiles方法代码示例

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


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

示例1:

void
TAO_FT_Naming_Server::combine_iors (FT_Naming::EntityKind kind, CORBA::Object_ptr peer)
{
  size_t local = ROOT;
  size_t combo = FT_ROOT;
  if (kind == FT_Naming::obj_grp)
    {
      local = GROUP;
      combo = FT_GROUP;
    }

  CORBA::Object_var IORM =
    this->orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, 0);

  TAO_IOP::TAO_IOR_Manipulation_var iorm =
    TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ());

  bool peer_nil = CORBA::is_nil (peer);
  bool local_nil =  CORBA::is_nil (this->iors_[local].ref_.in ());

  if (peer_nil || local_nil)
    {
      if (peer_nil)
        {
          this->assign (combo, false, this->iors_[local].ref_.in());
        }
    }
  else
    {
      if (this->server_role_ == PRIMARY)
        {
          this->assign (combo, false, iorm->add_profiles (this->iors_[local].ref_.in (),
                                                         peer));
        }
      else
        {

          this->assign (combo, false, iorm->add_profiles (peer,
                                                         this->iors_[local].ref_.in ()));
        }
    }

  if (CORBA::is_nil (this->iors_[combo].ref_.in ()) && TAO_debug_level > 0)
    {
      ORBSVCS_ERROR((LM_ERROR,
                     ACE_TEXT("(%P|%t) ERROR: could not combine")
                     ACE_TEXT(" primary and backup IORs for")
                     ACE_TEXT(" fault tolerant Naming Service.\n")));
    }

  this->write (size_t(combo));
}
开发者ID:milan-mpathix,项目名称:ATCD,代码行数:52,代码来源:FT_Naming_Server.cpp

示例2: iors


//.........这里部分代码省略.........

      // Verify ability to remove profiles from an IOR
      // First remove the second IOR from the merged IOR
      CORBA::Object_var just1 =
        iorm->remove_profiles (merged.in (), name2.in ());

      CORBA::String_var just1_ior =
        orb_->object_to_string (just1.in ());

      count = iorm->get_profile_count (just1.in ());

      if (count1 != count)
        ACE_DEBUG ((LM_ERROR,
                    "**ERROR (merge_profiles): "
                    "removing last IOR after a merge_iors ()\n"));

      ACE_DEBUG ((LM_DEBUG,
                  "\tJust 1 IOR(%d) = %C\n",
                  count,
                  just1_ior.in ()));

      in_count = iorm->is_in_ior (just1.in (), name1.in ());

      if (count1 != in_count)
        ACE_DEBUG ((LM_ERROR,
                    "**ERROR (merge_profiles): incorrect count returned for "
                    "is_in_ior"
                    "\nafter removal (%d)\n",
                    in_count));
      // **********************************************************************

      // Now try the add_profiles interface.
      CORBA::Object_var merged2 =
        iorm->add_profiles (just1.in (), name2.in ());

      count = iorm->get_profile_count (merged2.in ());

      if (count != (count1 + count2))
        ACE_DEBUG ((LM_ERROR,
                    "**ERROR: add_profile failed profile count test!\n"));

      CORBA::String_var merged2_ior =
        orb_->object_to_string (merged2.in ());

      ACE_DEBUG ((LM_DEBUG,
                  "\tAdding 2 back in IOR(%d) = %C\n",
                  count,
                  merged2_ior.in ()));

      // is_in_ior throws an exception if the intersection of the two
      // IORs is NULL.
      in_count = iorm->is_in_ior (merged2.in (), name1. in ());

      if (count1 != in_count)
        ACE_DEBUG ((LM_ERROR,
                    "**ERROR (add_profiles): is_in_ior returned profile "
                    "count bad (%d)!\n",
                    in_count));

      in_count = iorm->is_in_ior (merged2.in (), name2.in ());

      if (count2 != in_count)
        ACE_DEBUG ((LM_ERROR,
                    "**ERROR (add_profiles): is_in_ior returned "
                    "profile count bad!\n"));
开发者ID:asdlei00,项目名称:ACE,代码行数:66,代码来源:IORTest.cpp


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