本文整理汇总了C++中IPropertyTree::getPropTree方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyTree::getPropTree方法的具体用法?C++ IPropertyTree::getPropTree怎么用?C++ IPropertyTree::getPropTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyTree
的用法示例。
在下文中一共展示了IPropertyTree::getPropTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deletePkgInfo
bool deletePkgInfo(const char *name, const char *target, const char *process, bool globalScope)
{
Owned<IRemoteConnection> pkgSetsConn = querySDS().connect("/PackageSets/", myProcessSession(), RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT);
if (!pkgSetsConn)
throw MakeStringException(PKG_NONE_DEFINED, "No package sets defined");
IPropertyTree* packageSets = pkgSetsConn->queryRoot();
StringBuffer pkgSetId;
buildPkgSetId(pkgSetId, process);
VStringBuffer pkgSet_xpath("PackageSet[@id='%s']", pkgSetId.str());
IPropertyTree *pkgSetRegistry = packageSets->queryPropTree(pkgSet_xpath.str());
if (!pkgSetRegistry)
throw MakeStringException(PKG_TARGET_NOT_DEFINED, "No package sets defined for %s", process);
StringBuffer lcTarget(target);
target = lcTarget.toLowerCase().str();
StringBuffer lcName(name);
name = lcName.toLowerCase().str();
Owned<IPropertyTree> mapEntry;
StringBuffer xpath;
if (!globalScope)
{
xpath.appendf("PackageMap[@id='%s::%s'][@querySet='%s']", target, name, target);
mapEntry.setown(pkgSetRegistry->getPropTree(xpath.str()));
}
if (!mapEntry)
{
xpath.clear().appendf("PackageMap[@id='%s'][@querySet='%s']", name, target);
mapEntry.setown(pkgSetRegistry->getPropTree(xpath.str()));
if (!mapEntry)
throw MakeStringException(PKG_DELETE_NOT_FOUND, "Unable to delete %s - information not found", lcName.str());
}
StringAttr pmid(mapEntry->queryProp("@id"));
pkgSetRegistry->removeTree(mapEntry);
xpath.clear().appendf("PackageSet/PackageMap[@id='%s']", pmid.get());
if (!packageSets->hasProp(xpath))
{
Owned<IRemoteConnection> pkgMapsConn = querySDS().connect("/PackageMaps/", myProcessSession(), RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT);
if (!pkgMapsConn)
throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to retrieve PackageMaps information from dali [/PackageMaps]");
IPropertyTree *pkgMaps = pkgMapsConn->queryRoot();
if (!pkgMaps)
throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to retrieve PackageMaps information from dali [/PackageMaps]");
IPropertyTree *mapTree = pkgMaps->queryPropTree(xpath.clear().appendf("PackageMap[@id='%s']", pmid.get()).str());
if (mapTree)
pkgMaps->removeTree(mapTree);
}
return true;
}
示例2: appendClusterEndpoints
static void appendClusterEndpoints(IPropertyTree& cluster,SocketEndpointArray &eps)
{
SocketEndpoint ep;
Owned<IPropertyTree> master = cluster.getPropTree("ThorMasterProcess");
if (master)
appendNodeEndpoint(*master,eps);
Owned<IPropertyTreeIterator> nodes= cluster.getElements("ThorSlaveProcess");
if (nodes&&nodes->first()) {
do {
appendNodeEndpoint(nodes->query(),eps);
} while (nodes->next());
}
}