本文整理汇总了C++中ice::PropertyDict::find方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyDict::find方法的具体用法?C++ PropertyDict::find怎么用?C++ PropertyDict::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::PropertyDict
的用法示例。
在下文中一共展示了PropertyDict::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ex
//.........这里部分代码省略.........
{
case PROCESSOR_ARCHITECTURE_AMD64:
_machine = "x64";
break;
case PROCESSOR_ARCHITECTURE_IA64:
_machine = "IA64";
break;
case PROCESSOR_ARCHITECTURE_INTEL:
_machine = "x86";
break;
default:
_machine = "unknown";
break;
};
#else
struct utsname utsinfo;
uname(&utsinfo);
_os = utsinfo.sysname;
_hostname = utsinfo.nodename;
_release = utsinfo.release;
_version = utsinfo.version;
_machine = utsinfo.machine;
#endif
Ice::PropertiesPtr properties = communicator->getProperties();
//
// Try to obtain the number of processor sockets.
//
_nProcessorSockets = properties->getPropertyAsIntWithDefault("IceGrid.Node.ProcessorSocketCount", 0);
if(_nProcessorSockets == 0)
{
#if defined(_WIN32)
_nProcessorSockets = getSocketCount(_traceLevels->logger);
#elif defined(__linux)
IceUtilInternal::ifstream is(string("/proc/cpuinfo"));
set<string> ids;
int nprocessor = 0;
while(is)
{
string line;
getline(is, line);
if(line.find("processor") == 0)
{
nprocessor++;
}
else if(line.find("physical id") == 0)
{
nprocessor--;
ids.insert(line);
}
}
_nProcessorSockets = nprocessor + ids.size();
#else
// Not supported
_nProcessorSockets = 1;
#endif
}
string endpointsPrefix;
if(prefix == "IceGrid.Registry")
{
_name = properties->getPropertyWithDefault("IceGrid.Registry.ReplicaName", "Master");
endpointsPrefix = prefix + ".Client";
}
else
{
_name = properties->getProperty(prefix + ".Name");
endpointsPrefix = prefix;
}
Ice::PropertyDict props = properties->getPropertiesForPrefix(endpointsPrefix);
Ice::PropertyDict::const_iterator p = props.find(endpointsPrefix + ".PublishedEndpoints");
if(p != props.end())
{
_endpoints = p->second;
}
else
{
_endpoints = properties->getProperty(endpointsPrefix + ".Endpoints");
}
string cwd;
if(IceUtilInternal::getcwd(cwd) != 0)
{
throw "cannot get the current directory:\n" + IceUtilInternal::lastErrorToString();
}
_cwd = string(cwd);
_dataDir = properties->getProperty(prefix + ".Data");
if(!IceUtilInternal::isAbsolutePath(_dataDir))
{
_dataDir = _cwd + '/' + _dataDir;
}
if(_dataDir[_dataDir.length() - 1] == '/')
{
_dataDir = _dataDir.substr(0, _dataDir.length() - 1);
}
}