本文整理汇总了C++中ice::PropertiesPtr::getPropertiesForPrefix方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertiesPtr::getPropertiesForPrefix方法的具体用法?C++ PropertiesPtr::getPropertiesForPrefix怎么用?C++ PropertiesPtr::getPropertiesForPrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::PropertiesPtr
的用法示例。
在下文中一共展示了PropertiesPtr::getPropertiesForPrefix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getProperties
std::map<string, string> client::getPropertyMap(const Ice::PropertiesPtr& properties) const {
Ice::PropertiesPtr props;
if (!properties) {
props = getProperties();
} else {
props = properties;
}
std::map<string, string> pm;
Ice::PropertyDict omeroProperties = props->getPropertiesForPrefix("omero");
Ice::PropertyDict::const_iterator beg = omeroProperties.begin();
Ice::PropertyDict::const_iterator end = omeroProperties.end();
while (beg != end) {
pm[(*beg).first] = (*beg).second;
beg++;
}
Ice::PropertyDict iceProperties = props->getPropertiesForPrefix("Ice");
beg = iceProperties.begin();
end = iceProperties.end();
while (beg != end) {
pm[(*beg).first] = (*beg).second;
beg++;
}
return pm;
}
示例2: FileCache
NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter,
NodeSessionManager& sessions,
const ActivatorPtr& activator,
const IceUtil::TimerPtr& timer,
const TraceLevelsPtr& traceLevels,
const NodePrx& proxy,
const string& name,
const UserAccountMapperPrx& mapper,
const string& instanceName) :
_communicator(adapter->getCommunicator()),
_adapter(adapter),
_sessions(sessions),
_activator(activator),
_timer(timer),
_traceLevels(traceLevels),
_name(name),
_proxy(proxy),
_redirectErrToOut(false),
_allowEndpointsOverride(false),
_waitTime(0),
_instanceName(instanceName),
_userAccountMapper(mapper),
_platform("IceGrid.Node", _communicator, _traceLevels),
_fileCache(new FileCache(_communicator)),
_serial(1),
_consistencyCheckDone(false)
{
Ice::PropertiesPtr props = _communicator->getProperties();
const_cast<string&>(_dataDir) = _platform.getDataDir();
const_cast<string&>(_serversDir) = _dataDir + "/servers";
const_cast<string&>(_tmpDir) = _dataDir + "/tmp";
const_cast<Ice::Int&>(_waitTime) = props->getPropertyAsIntWithDefault("IceGrid.Node.WaitTime", 60);
const_cast<string&>(_outputDir) = props->getProperty("IceGrid.Node.Output");
const_cast<bool&>(_redirectErrToOut) = props->getPropertyAsInt("IceGrid.Node.RedirectErrToOut") > 0;
const_cast<bool&>(_allowEndpointsOverride) = props->getPropertyAsInt("IceGrid.Node.AllowEndpointsOverride") > 0;
//
// Parse the properties override property.
//
vector<string> overrides = props->getPropertyAsList("IceGrid.Node.PropertiesOverride");
if(!overrides.empty())
{
for(vector<string>::iterator p = overrides.begin(); p != overrides.end(); ++p)
{
if(p->find("--") != 0)
{
*p = "--" + *p;
}
}
Ice::PropertiesPtr p = Ice::createProperties();
p->parseCommandLineOptions("", overrides);
Ice::PropertyDict propDict = p->getPropertiesForPrefix("");
for(Ice::PropertyDict::const_iterator q = propDict.begin(); q != propDict.end(); ++q)
{
_propertiesOverride.push_back(createProperty(q->first, q->second));
}
}
}
示例3: ex
TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) :
_communicator(communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
_traceLevel = properties->getPropertyAsInt("IceSSL.Trace.Security");
string key;
try
{
key = "IceSSL.TrustOnly";
_all = parse(properties->getProperty(key));
key = "IceSSL.TrustOnly.Client";
_client = parse(properties->getProperty(key));
key = "IceSSL.TrustOnly.Server";
_allServer = parse(properties->getProperty(key));
Ice::PropertyDict dict = properties->getPropertiesForPrefix("IceSSL.TrustOnly.Server.");
for(Ice::PropertyDict::const_iterator p = dict.begin(); p != dict.end(); ++p)
{
string name = p->first.substr(string("IceSSL.TrustOnly.Server.").size());
key = p->first;
_server[name] = parse(p->second);
}
}
catch(const ParseException& e)
{
Ice::PluginInitializationException ex(__FILE__, __LINE__);
ex.reason = "IceSSL: invalid property " + key + ":\n" + e.reason;
throw ex;
}
}
示例4:
RangeAnalyzer::RangeAnalyzer() :
Analyzer() {
ServiceI& service = ServiceI::instance();
Ice::PropertiesPtr prop = service.getCommunicator()->getProperties();
_configMap = prop->getPropertiesForPrefix("RangeAnalyzer");
_min = prop->getPropertyAsIntWithDefault("RangeAnalyzer.Min", 0);
_max = prop->getPropertyAsIntWithDefault("RangeAnalyzer.Max", 100);
_moremax = prop->getPropertyAsIntWithDefault("RangeAnalyzer.MoreMax", 200);
_moremin = prop->getPropertyAsIntWithDefault("RangeAnalyzer.MoreMin", 0);
_unit=prop->getPropertyWithDefault("RangeAnalyzer.Unit","");
_deviation=prop->getPropertyAsIntWithDefault("RangeAnalyzer.Deviation",100);
}
示例5:
FrequencyAnalyzer::FrequencyAnalyzer() :
Analyzer() {
ServiceI& service = ServiceI::instance();
Ice::PropertiesPtr prop = service.getCommunicator()->getProperties();
_configMap = prop->getPropertiesForPrefix("FrequencyAnalyzer");
/*stringstream stream(prop->getProperty("Mobile"));
string mobile;
while (stream >> mobile) {
_alert->addMobile(mobile);
}*/
_time = prop->getPropertyAsIntWithDefault("FrequencyAnalyzer.Time", 60);
_size = prop->getPropertyAsIntWithDefault("FrequencyAnalyzer.Size", 6);
}
示例6: qPrintable
MurmurIce::MurmurIce() {
count = 0;
if (meta->mp.qsIceEndpoint.isEmpty())
return;
Ice::PropertiesPtr ipp = Ice::createProperties();
::Meta::mp.qsSettings->beginGroup("Ice");
foreach(const QString &v, ::Meta::mp.qsSettings->childKeys()) {
ipp->setProperty(u8(v), u8(::Meta::mp.qsSettings->value(v).toString()));
}
::Meta::mp.qsSettings->endGroup();
Ice::PropertyDict props = ippProperties->getPropertiesForPrefix("");
Ice::PropertyDict::iterator i;
for (i=props.begin(); i != props.end(); ++i) {
ipp->setProperty((*i).first, (*i).second);
}
ipp->setProperty("Ice.ImplicitContext", "Shared");
Ice::InitializationData idd;
idd.properties = ipp;
try {
communicator = Ice::initialize(idd);
if (! meta->mp.qsIceSecretWrite.isEmpty()) {
::Ice::ImplicitContextPtr impl = communicator->getImplicitContext();
if (impl)
impl->put("secret", u8(meta->mp.qsIceSecretWrite));
}
adapter = communicator->createObjectAdapterWithEndpoints("Murmur", qPrintable(meta->mp.qsIceEndpoint));
MetaPtr m = new MetaI;
MetaPrx mprx = MetaPrx::uncheckedCast(adapter->add(m, communicator->stringToIdentity("Meta")));
adapter->addServantLocator(new ServerLocator(), "s");
iopServer = new ServerI;
adapter->activate();
foreach(const Ice::EndpointPtr ep, mprx->ice_getEndpoints()) {
qWarning("MurmurIce: Endpoint \"%s\" running", qPrintable(u8(ep->toString())));
}
meta->connectListener(this);
} catch (Ice::Exception &e) {
qCritical("MurmurIce: Initialization failed: %s", qPrintable(u8(e.ice_name())));
}
}
示例7: ex
TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) :
_communicator(communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
_traceLevel = properties->getPropertyAsInt("IceSSL.Trace.Security");
string key;
try
{
key = "IceSSL.TrustOnly";
parse(properties->getProperty(key), _rejectAll, _acceptAll);
key = "IceSSL.TrustOnly.Client";
parse(properties->getProperty(key), _rejectClient, _acceptClient);
key = "IceSSL.TrustOnly.Server";
parse(properties->getProperty(key), _rejectAllServer, _acceptAllServer);
Ice::PropertyDict dict = properties->getPropertiesForPrefix("IceSSL.TrustOnly.Server.");
for(Ice::PropertyDict::const_iterator p = dict.begin(); p != dict.end(); ++p)
{
string name = p->first.substr(string("IceSSL.TrustOnly.Server.").size());
key = p->first;
list<DistinguishedName> reject, accept;
parse(p->second, reject, accept);
if(!reject.empty())
{
_rejectServer[name] = reject;
}
if(!accept.empty())
{
_acceptServer[name] = accept;
}
}
}
catch(const ParseException& e)
{
Ice::PluginInitializationException ex(__FILE__, __LINE__);
ex.reason = "IceSSL: invalid property " + key + ":\n" + e.reason;
throw ex;
}
}
示例8: 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);
}
}