本文整理汇总了C++中CfgNode::getDef方法的典型用法代码示例。如果您正苦于以下问题:C++ CfgNode::getDef方法的具体用法?C++ CfgNode::getDef怎么用?C++ CfgNode::getDef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CfgNode
的用法示例。
在下文中一共展示了CfgNode::getDef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pcomps
/* execute the specified type of actions on the specified "multi" node (i.e.,
* multi-value leaf node) during commit. act is one of "delete_act",
* "update_act", and "syntax_act", representing the different processing
* passes.
*
* see comment for _exec_node_actions() above about clist.
*/
static bool
_exec_multi_node_actions(Cstore& cs, const CfgNode& node, vtw_act_type act,
CommittedPathListT *clist = NULL)
{
if (!node.isMulti()) {
// fail if this is called with a non-multi node
OUTPUT_USER("_exec_multi_node_actions() called with non-multi[%s]\n",
node.getCommitPath().to_string().c_str());
return false;
}
const vtw_def *def = node.getDef();
Cpath pcomps(node.getCommitPath());
if (clist) {
CommitState s = node.getCommitState();
if (s == COMMIT_STATE_ADDED || s == COMMIT_STATE_DELETED) {
/* for multi-value leaf node, add the node itself to the
* "committed list" if it is added/deleted.
*/
tr1::shared_ptr<Cpath> ppdisp(new Cpath(pcomps));
clist->push_back(CommittedPathT(s, ppdisp));
}
}
for (size_t i = 0; i < _get_num_commit_multi_values(node); i++) {
CommitState s = _get_commit_multi_state_at(node, i);
if (s == COMMIT_STATE_UNCHANGED) {
// nop for unchanged value
continue;
}
string v = _get_commit_multi_value_at(node, i);
auto_ptr<char> at_str(strdup(v.c_str()));
tr1::shared_ptr<Cpath> pdisp(new Cpath(pcomps));
pdisp->push(v);
if (clist) {
// add the value to the committed list
clist->push_back(CommittedPathT(s, pdisp));
continue;
}
if (act == syntax_act) {
// syntax pass
if (s != COMMIT_STATE_ADDED) {
continue;
}
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, syntax_act, def)) {
return false;
}
} else {
//// delete or update pass
// begin
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, begin_act, def)) {
return false;
}
/* note that for CHANGED value we need to do BOTH a delete AND a
* create. this is the fix for bug 5460. more information in later
* comment about bug 5460.
*/
if (act == delete_act) {
// delete pass
if (s == COMMIT_STATE_DELETED || s == COMMIT_STATE_CHANGED) {
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, delete_act, def)) {
return false;
}
}
} else {
// update pass
if (s == COMMIT_STATE_ADDED || s == COMMIT_STATE_CHANGED) {
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, create_act, def)) {
return false;
}
}
}
// end
if (!_exec_tmpl_actions(cs, s, at_str.get(), pcomps, *(pdisp.get()),
node, end_act, def)) {
return false;
}
}
}
return true;
}