本文整理汇总了C++中MatchExpression::setTag方法的典型用法代码示例。如果您正苦于以下问题:C++ MatchExpression::setTag方法的具体用法?C++ MatchExpression::setTag怎么用?C++ MatchExpression::setTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatchExpression
的用法示例。
在下文中一共展示了MatchExpression::setTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tagMemo
void PlanEnumerator::tagMemo(size_t id) {
QLOG() << "Tagging memoID " << id << endl;
NodeAssignment* assign = _memo[id];
verify(NULL != assign);
if (NULL != assign->pred) {
PredicateAssignment* pa = assign->pred.get();
verify(NULL == pa->expr->getTag());
verify(pa->indexToAssign < pa->first.size());
pa->expr->setTag(new IndexTag(pa->first[pa->indexToAssign]));
}
else if (NULL != assign->orAssignment) {
OrAssignment* oa = assign->orAssignment.get();
for (size_t i = 0; i < oa->subnodes.size(); ++i) {
tagMemo(oa->subnodes[i]);
}
}
else if (NULL != assign->newAnd) {
AndAssignment* aa = assign->newAnd.get();
if (AndAssignment::MANDATORY == aa->state) {
verify(aa->counter < aa->mandatory.size());
const OneIndexAssignment& assign = aa->mandatory[aa->counter];
for (size_t i = 0; i < assign.preds.size(); ++i) {
MatchExpression* pred = assign.preds[i];
verify(NULL == pred->getTag());
pred->setTag(new IndexTag(assign.index, assign.positions[i]));
}
}
else if (AndAssignment::PRED_CHOICES == aa->state) {
verify(aa->counter < aa->predChoices.size());
const OneIndexAssignment& assign = aa->predChoices[aa->counter];
for (size_t i = 0; i < assign.preds.size(); ++i) {
MatchExpression* pred = assign.preds[i];
verify(NULL == pred->getTag());
pred->setTag(new IndexTag(assign.index, assign.positions[i]));
}
}
else {
verify(AndAssignment::SUBNODES == aa->state);
verify(aa->counter < aa->subnodes.size());
tagMemo(aa->subnodes[aa->counter]);
}
}
else {
verify(0);
}
}