本文整理汇总了C++中CfgNode::commitChildDeleteFailed方法的典型用法代码示例。如果您正苦于以下问题:C++ CfgNode::commitChildDeleteFailed方法的具体用法?C++ CfgNode::commitChildDeleteFailed怎么用?C++ CfgNode::commitChildDeleteFailed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CfgNode
的用法示例。
在下文中一共展示了CfgNode::commitChildDeleteFailed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pcomps
/* execute the specified type of actions on the specified node.
*
* note that if the "committed list" clist is specified, no action will be
* performed except adding the node to the committed list (if needed).
*/
static bool
_exec_node_actions(Cstore& cs, CfgNode& node, vtw_act_type act,
CommittedPathListT *clist = NULL)
{
if (node.isMulti()) {
// fail if this is called with a multi node
OUTPUT_USER("_exec_node_actions() called with multi[%s]\n",
node.getCommitPath().to_string().c_str());
return false;
}
CommitState s = node.getCommitState();
if (s == COMMIT_STATE_DELETED && node.commitChildDeleteFailed()) {
return false;
}
bool nop = false;
if (!node.getActions(act)) {
// no actions => success
nop = true;
}
auto_ptr<char> at_str;
Cpath pcomps(node.getCommitPath());
tr1::shared_ptr<Cpath> pdisp(new Cpath(pcomps));
bool add_parent_to_committed = false;
if (node.isLeaf()) {
// single-value node
if (s == COMMIT_STATE_CHANGED) {
if (node.commitValueBefore() == node.commitValueAfter()) {
// value didn't change (only "default" status), so nop
nop = true;
}
at_str.reset(strdup(node.commitValueAfter().c_str()));
} else {
if (s == COMMIT_STATE_ADDED || s == COMMIT_STATE_DELETED) {
// add parent to "committed list" if it's added/deleted
add_parent_to_committed = true;
}
at_str.reset(strdup(node.getValue().c_str()));
}
pdisp->push(at_str.get());
} else if (node.isValue()) {
// tag value
at_str.reset(strdup(node.getValue().c_str()));
pcomps.pop(); // paths need to be at the "node" level
} else {
// typeless node
at_str.reset(strdup(node.getName().c_str()));
}
if (clist) {
/* note that even though every "tag value" will be added to the
* "committed list" here, simply adding the corresponding "tag node"
* here does not work.
*
* basically there are three scenarios for a tag node:
* (1) in both active and working
* i.e., tag node itself is unchanged => doesn't need to be added
* to committed list since "committed query" will check for this
* condition first.
* (2) only in working
* i.e., all tag values are being added so tag node itself is also
* being added. in this case, tag node must be considered
* "committed" after the first tag value has been processed
* successfully.
* (3) only in active
* i.e., all tag values are being deleted so is tag node itself.
* in this case, tag node must be considered "committed" only
* after all tag values have been processed successfully.
*
* cases (2) and (3) cannot be handled here since they depend on the
* processing order and outcome of siblings of tag values. therefore,
* tag node will never be added to the committed list, and the
* "committed query" function will need to handle tag nodes as special
* case.
*/
if (add_parent_to_committed) {
tr1::shared_ptr<Cpath> ppdisp(new Cpath(pcomps));
clist->push_back(CommittedPathT(s, ppdisp));
}
clist->push_back(CommittedPathT(s, pdisp));
return true;
}
if (nop) {
// nothing to do
return true;
}
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, act, node.getDef())) {
if (act == create_act) {
_set_node_commit_create_failed(node);
}
//.........这里部分代码省略.........