本文整理汇总了C++中tao_iop::TAO_IOR_Manipulation_var::is_primary_set方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_IOR_Manipulation_var::is_primary_set方法的具体用法?C++ TAO_IOR_Manipulation_var::is_primary_set怎么用?C++ TAO_IOR_Manipulation_var::is_primary_set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tao_iop::TAO_IOR_Manipulation_var
的用法示例。
在下文中一共展示了TAO_IOR_Manipulation_var::is_primary_set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
//.........这里部分代码省略.........