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


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

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


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

示例1: iogr_prop

CORBA::Object_ptr
make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, Test::Hello_var *refs)
{
  FT::TagFTGroupTaggedComponent ft_tag_component;
  // Create the list
  TAO_IOP::TAO_IOR_Manipulation::IORList iors (number_of_servers);
  iors.length(number_of_servers);
  for (CORBA::ULong i = 0; i < number_of_servers; ++i)
    {
      iors [i] = CORBA::Object::_duplicate (refs[i].in ());
    }

  CORBA::Object_var new_ref =
    iorm->merge_iors (iors);

  // Property values

  // Major and Minor revision numbers
  ft_tag_component.component_version.major = (CORBA::Octet) 1;
  ft_tag_component.component_version.minor = (CORBA::Octet) 0;

  // Domain id
  //const char *id = "iogr_testing";
  ft_tag_component.group_domain_id = domain_id;

  // Object group id
  ft_tag_component.object_group_id = group_id;

  // Version
  ft_tag_component.object_group_ref_version = group_version;

  // Construct the IOGR Property class
  TAO_FT_IOGR_Property iogr_prop (ft_tag_component);

  // Set the property
  CORBA::Boolean retval = iorm->set_property (&iogr_prop,
                                              new_ref.in ());

  // Set the primary
  // See we are setting the second ior as the primary
  if (retval != 0)
    {
      retval = iorm->set_primary (&iogr_prop,
                                  refs[0].in (),
                                  new_ref.in ());
    }

  return new_ref._retn ();
}
开发者ID:asdlei00,项目名称:ACE,代码行数:49,代码来源:client2.cpp

示例2: iogr_prop

int
Manager::set_properties (void)
{
  FT::TagFTGroupTaggedComponent ft_tag_component;

  // Property values

  // Major and Minor revision numbers
  ft_tag_component.component_version.major = (CORBA::Octet) 1;
  ft_tag_component.component_version.minor = (CORBA::Octet) 0;

  // Domain id
  const char *id = "iogr_testing";
  ft_tag_component.group_domain_id = id;

  // Object group id
  ft_tag_component.object_group_id =
    (CORBA::ULongLong) 10;

  // Version
  ft_tag_component.object_group_ref_version =
    (CORBA::ULong) 5;

  // Construct the IOGR Property class
  TAO_FT_IOGR_Property iogr_prop (ft_tag_component);

  // Set the property
  CORBA::Boolean retval = iorm->set_property (&iogr_prop,
                                              this->merged_set_.in ());

  // Set the primary
  // See we are setting the second ior as the primary
  if (retval != 0)
    {
      retval = iorm->set_primary (&iogr_prop,
                                  this->object_secondary_.in (),
                                  this->merged_set_.in ());
    }

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

示例3: iogr_prop

void
add_ft_prop (CORBA::ORB_ptr o,
             CORBA::Object_ptr obj1,
             CORBA::Object_ptr obj2)
{
  // Get an object reference for the ORBs IORManipultion object!
  CORBA::Object_var IORM =
    o->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
                                   0);

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

  FT::TagFTGroupTaggedComponent ft_tag_component;

  // Property values
  // Major and Minor revision numbers
  ft_tag_component.component_version.major = (CORBA::Octet) 1;
  ft_tag_component.component_version.minor = (CORBA::Octet) 0;

  // Domain id
  const char *id = "version_testing";
  ft_tag_component.group_domain_id = id;

  // Object group id
  ft_tag_component.object_group_id =
    (CORBA::ULongLong) 10;

  // Version
  ft_tag_component.object_group_ref_version =
    (CORBA::ULong) 1;

  // Construct the IOGR Property class
  TAO_FT_IOGR_Property iogr_prop (ft_tag_component);

  // Set the property for object 1
  CORBA::Boolean retval = iorm->set_property (&iogr_prop,
                                              obj1);

  if (retval != 0)
    {
      retval = iorm->set_primary (&iogr_prop,
                                  obj1,
                                  obj1);
    }


  // Set the property for object 2
  // Change the version. That is the point of this test
  // Version
  ft_tag_component.object_group_ref_version = (CORBA::ULong) 5;

  retval = iorm->set_property (&iogr_prop,
                                              obj2);

  if (retval != 0)
    {
      retval = iorm->set_primary (&iogr_prop,
                                  obj2,
                                  obj2);
    }

  return;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:64,代码来源:server.cpp

示例4: prop

int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{

  ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n"));
  ACE_DEBUG ((LM_DEBUG, "Running the IOGRManipulation Tests.\n"));

  try
    {
      // Retrieve the ORB.
      CORBA::ORB_var orb_ = CORBA::ORB_init (argc, argv);
      // **********************************************************************

      // Get an object reference for the ORBs IORManipulation object!
      CORBA::Object_var IORM =
        orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION, 0);

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

      // Create a few fictitious IORs
      CORBA::Object_var name1 =
        orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz");
      CORBA::Object_var name2 =
        orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz");

      // **********************************************************************
      // Create IOR list for use with merge_iors.
      TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
      iors.length (2);
      iors [0] = name1;
      iors [1] = name2;
      // **********************************************************************

      CORBA::Object_var merged = iorm->merge_iors (iors);

      // Check for set and get primaries
      // Make a dummy property set
      FT::TagFTGroupTaggedComponent ft_tag_component;
      TAO_FT_IOGR_Property prop (ft_tag_component);

      CORBA::Boolean retval =
        iorm->set_primary (&prop, name2.in (), merged.in ());

      if (retval != 0)
        {
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("\tThe primary has been set\n")));
        }
      else
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("\tError in setting primary\n")));
          return -1;
        }

      // Check whether a primary has been set
      retval = iorm->is_primary_set (&prop, merged.in ());

      if (retval)
        {
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("\tis_primary_set () returned true\n")));
        }
      else
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("\tis_primary_set () returned false\n")));

          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("\tSo Exiting\n")));
          return -1;
        }

      // Get the primary
      CORBA::Object_var prim = iorm->get_primary (&prop, merged.in ());

      // Check whether we got back the right primary
      if (prim->_is_equivalent (name2.in ()))
        {
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("\tWe got the right primary back\n")));
        }
      else
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("\tWe have a problem in getting the right primary\n")));
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("\tSo exiting\n")));
          return -1;
        }
      // **********************************************************************
      // Set properties
      // Property values

      // Major and Minor revision numbers
      ft_tag_component.component_version.major = (CORBA::Octet) 1;
      ft_tag_component.component_version.minor = (CORBA::Octet) 0;

//.........这里部分代码省略.........
开发者ID:CCJY,项目名称:ATCD,代码行数:101,代码来源:IOGRTest.cpp


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