本文整理汇总了C++中tr1::shared_ptr::isTagNode方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::isTagNode方法的具体用法?C++ shared_ptr::isTagNode怎么用?C++ shared_ptr::isTagNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr1::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::isTagNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vpath
bool
commit::isCommitPathEffective(Cstore& cs, const Cpath& pcomps,
tr1::shared_ptr<Ctemplate> def,
bool in_active, bool in_working)
{
if (in_active && in_working) {
// remain the same
return true;
}
if (!in_active && !in_working) {
// doesn't exist
return false;
}
// at this point, in_active corresponds to "being deleted"
if (def->isTagNode()) {
// special handling for tag nodes, which are never marked
vector<string> tvals;
// get tag values from active or working config
cs.cfgPathGetChildNodes(pcomps, tvals, in_active);
Cpath vpath(pcomps);
/* note that there should be at least 1 tag value since tag node
* cannot exist without tag value.
*/
for (size_t i = 0; i < tvals.size(); i++) {
vpath.push(tvals[i]);
if (in_active) {
// being deleted => all tag values are being deleted
if (!cs.cfgPathMarkedCommitted(vpath, true)) {
/* a tag value is not marked committed
* => a tag value has not been deleted
* => tag node has not been deleted
* => still effective
*/
return true;
}
} else {
// being added => all tag values are being added
if (cs.cfgPathMarkedCommitted(vpath, false)) {
/* a tag value is marked committed
* => a tag value has been added
* => tag node has been added
* => already effective
*/
return true;
}
}
vpath.pop();
}
// not effective
return false;
}
/* if not tag node, effectiveness corresponds to committed marking:
* if deleted (i.e., in_active), then !marked is effective
* otherwise (i.e., added), marked is effective
*/
bool marked = cs.cfgPathMarkedCommitted(pcomps, in_active);
return (in_active ? !marked : marked);
}