本文整理汇总了C++中ice::ObjectPtr::ice_staticId方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::ice_staticId方法的具体用法?C++ ObjectPtr::ice_staticId怎么用?C++ ObjectPtr::ice_staticId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::ice_staticId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
Ice::ObjectPtr viewerPtr;
//signal(SIGINT,signalHandler);
Ice::CommunicatorPtr ic;
try{
ic = EasyIce::initialize(argc, argv);
Ice::PropertiesPtr prop = ic->getProperties();
std::string Endpoints = prop->getProperty("Visualization.Endpoints");
// Naming Service
int nsActive = prop->getPropertyAsIntWithDefault("NamingService.Enabled", 0);
if (nsActive)
{
std::string ns_proxy = prop->getProperty("NamingService.Proxy");
try
{
namingService = new jderobot::ns(ic, ns_proxy);
}
catch (Ice::ConnectionRefusedException& ex)
{
jderobot::Logger::getInstance()->error("Impossible to connect with NameService!");
exit(-1);
}
}
Ice::ObjectAdapterPtr adapter =ic->createObjectAdapterWithEndpoints("Visualization", Endpoints);
std::string objPrefix("Visualization.");
std::string viewerName = prop->getProperty(objPrefix + "Name");
Ice::ObjectPtr object = new visualization::VisualizationI(objPrefix, ic);
adapter->add(object, ic->stringToIdentity(viewerName));
if (namingService)
namingService->bind(viewerName, Endpoints, object->ice_staticId());
adapter->activate();
ic->waitForShutdown();
}catch (const Ice::Exception& ex) {
std::cerr << ex<<" 1 " << std::endl;
exit(-1);
} catch (const char* msg) {
std::cerr << msg<< " 2 " << std::endl;
exit(-1);
}
}