本文整理汇总了C++中ObjectPrxPtr::ice_ids方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::ice_ids方法的具体用法?C++ ObjectPrxPtr::ice_ids怎么用?C++ ObjectPrxPtr::ice_ids使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPrxPtr
的用法示例。
在下文中一共展示了ObjectPrxPtr::ice_ids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTestEndpoint
TestIntfPrxPtr
allTests(const CommunicatorPtr& communicator)
{
const string endp = getTestEndpoint(communicator, 0);
cout << "testing stringToProxy... " << flush;
ObjectPrxPtr base = communicator->stringToProxy("asm:" + endp);
test(base);
cout << "ok" << endl;
cout << "testing checked cast... " << flush;
TestIntfPrxPtr obj = ICE_CHECKED_CAST(TestIntfPrx, base);
test(obj);
#ifdef ICE_CPP11_MAPPING
test(Ice::targetEquals(obj, base));
#else
test(obj == base);
#endif
cout << "ok" << endl;
cout << "testing ice_ids... " << flush;
try
{
ObjectPrxPtr o = communicator->stringToProxy("category/locate:" + endp);
o->ice_ids();
test(false);
}
catch(const UnknownUserException& ex)
{
test(ex.unknown == "::Test::TestIntfUserException");
}
catch(...)
{
test(false);
}
try
{
ObjectPrxPtr o = communicator->stringToProxy("category/finished:" + endp);
o->ice_ids();
test(false);
}
catch(const UnknownUserException& ex)
{
test(ex.unknown == "::Test::TestIntfUserException");
}
catch(...)
{
test(false);
}
cout << "ok" << endl;
cout << "testing servant locator..." << flush;
base = communicator->stringToProxy("category/locate:" + endp);
obj = ICE_CHECKED_CAST(TestIntfPrx, base);
try
{
ICE_CHECKED_CAST(TestIntfPrx,
communicator->stringToProxy("category/unknown:" + getTestEndpoint(communicator, 0)));
}
catch(const ObjectNotExistException&)
{
}
cout << "ok" << endl;
cout << "testing default servant locator..." << flush;
base = communicator->stringToProxy("anothercategory/locate:" + endp);
obj = ICE_CHECKED_CAST(TestIntfPrx, base);
base = communicator->stringToProxy("locate:" + endp);
obj = ICE_CHECKED_CAST(TestIntfPrx, base);
try
{
ICE_CHECKED_CAST(TestIntfPrx,
communicator->stringToProxy("anothercategory/unknown:" + getTestEndpoint(communicator, 0)));
}
catch(const ObjectNotExistException&)
{
}
try
{
ICE_CHECKED_CAST(TestIntfPrx, communicator->stringToProxy("unknown:" + endp));
}
catch(const Ice::ObjectNotExistException&)
{
}
cout << "ok" << endl;
cout << "testing locate exceptions... " << flush;
base = communicator->stringToProxy("category/locate:" + endp);
obj = ICE_CHECKED_CAST(TestIntfPrx, base);
testExceptions(obj);
cout << "ok" << endl;
cout << "testing finished exceptions... " << flush;
base = communicator->stringToProxy("category/finished:" + endp);
obj = ICE_CHECKED_CAST(TestIntfPrx, base);
testExceptions(obj);
//
// Only call these for category/finished.
//
//.........这里部分代码省略.........